Each program on taskbar has an item on it, and pressing this item will activate the corresponding program
In fact, these program items on taskbar use tab control, so if we can get taskbar
The hwnd of the tab control (release AB) on, we can delete the items on it at will.
1. When an application is started, in addition to sending the wm_active wake-up window, it will also notify
Using AB (send abm_activate) to create the buttons and icons of the Program on the taskbar
2. To make an application fail to be switched over by pressing alt-tab, you must first change the window type of the application.
Toolwindow; however, using show vbmodal in VB can achieve the same effect.
Option explicitprivate declare function findwindow lib "USER32" alias "find0000wa" (_ byval lpclassname as string, _ byval lpwindowname as string) as long private declare function find1_wex lib "USER32" alias "find1_wexa" (_ byval hwndparent as long, _ byval hwndchild as long, _ byval lpclassname as string, _ byval lpwindowname as string) as longconst gwl_exstyle = (-20) const ws_ex_toolwindow = & h80private declare function setwindowlong lib "USER32" alias "setwindowlonga" (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as longprivate declare function sendmessage lib "USER32" alias "sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, lparam as any) as longprivate const tcm_first = & h1300 'tab control messagesprivate const Limit = (tcm_first + 2) Private const Limit = (tcm_first + 3) Private const tcm_getitemcount = (tcm_first + 4) private const tcm_getitema = (tcm_first + 5) Private const tcm_getitemw = (tcm_first + 60) Private const Limit = (tcm_first + 6) Private const tcm_setitemw = (tcm_first + 61) private const Limit = (tcm_first + 7) Private const Limit = (tcm_first + 62) Private const tcm_deleteitem = (tcm_first + 8) Private const tcm_deleteallitems = (tcm_first + 9) private const partition = (tcm_first + 10) Private const tcm_getcursel = (tcm_first + 11) Private const tcm_setcursel = (tcm_first + 12) Private const tcm_hittest = (tcm_first + 13) private const align = (tcm_first + 14) Private const tcm_adjustrect = (tcm_first + 40) Private const tcm_setitemsize = (tcm_first + 41) Private const tcm_removeimage = (tcm_first + 42) private const tcm_setpadding = (tcm_first + 43) Private const tcm_getrowcount = (tcm_first + 44) Private const rows = (tcm_first + 45) Private const tcm_settooltips = (tcm_first + 46) private const tcm_getcurfocus = (tcm_first + 47) Private const tcm_setcurfocus = (tcm_first + 48) Private const tcm_setmintabwidth = (tcm_first + 49) Private const Limit = (tcm_first + 50) private const tcm_highlightitem = (tcm_first + 51) Private const tcm_setextendedstyle = (tcm_first + 52) Private const tcm_getextendedstyle = (tcm_first + 53) private const tcm_setunicodeformat = & h2005private const tcm_getunicodeformat = & h2006private sub form_load () dim lreturn as long dim lhwnd as long lreturn = findwindow ("Callback", vbnullstring) 'First find shell tray handle lreturn = find1_wex (lreturn, 0, "handle", vbnullstring) 'and find its child lhwnd = find1_wex (lreturn, 0, "commanabcontrol32", vbnullstring) 'This is the me. show 'doevents me. visible = false': Set window extend style to toolwindow. Pressing alt-tab cannot switch to lreturn = setwindowlong (Me. hwnd, gwl_exstyle, ws_ex_toolwindow) 'should set the visible attribute to enable me to change the window style API. visible = true' Delete the last item on the consumer AB lreturn = sendmessage (lhwnd, tcm_getitemcount, 0, byval 0) lreturn = sendmessage (lhwnd, tcm_deleteitem, lreturn-1, byval 0) end sub |