Re: SysTrayIconRemove
- Posted by andi49 Jul 25, 2011
- 2401 views
Hallo, here is a piece of code that helps me get rid of some Icons from a Wlan USB Stick. It's a kind of BruteForce, because it forces the DesktopWindow and all it Childs to Redraw. So you maybe got some flicker on the screen.
Hope it helps
Andreas
include dll.e object Void constant Null=0 constant user32 = open_dll("user32.dll") constant myRedrawWindow = define_c_func(user32,"RedrawWindow",{C_ULONG,C_INT,C_INT,C_INT},C_INT) function or_all(sequence s) -- or together all elements of a sequence atom result result = 0 for i = 1 to length(s) do result = or_bits(result, s[i]) end for return result end function -- RedrawWindow() flags global constant RDW_INVALIDATE =#0001, RDW_INTERNALPAINT =#0002, RDW_ERASE =#0004, RDW_VALIDATE =#0008, RDW_NOINTERNALPAINT =#0010, RDW_NOERASE =#0020, RDW_NOCHILDREN =#0040, RDW_ALLCHILDREN =#0080, RDW_UPDATENOW =#0100, RDW_ERASENOW =#0200, RDW_FRAME =#0400, RDW_NOFRAME =#0800 procedure RedrawWindow(atom handle) --Parameters --hWnd [in] --A handle to the window to be redrawn. If this parameter is NULL, the desktop window is updated. --BOOL RedrawWindow( -- __in HWND hWnd, -- __in const RECT *lprcUpdate, -- __in HRGN hrgnUpdate, -- __in UINT flags -- ); Void=c_func(myRedrawWindow,{handle,Null,Null,or_all({RDW_UPDATENOW,RDW_ALLCHILDREN,RDW_INVALIDATE,RDW_ERASE})}) end procedure RedrawWindow(Null)