Hi Seb
to remove the icon before redrawing a new one use a panel free it then recreate it. this works example below.
some information on device contexts found on msdn
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_0g6r.asp
kev
to remove the icon before redrawing a new one use a panel free it then recreate it. this works example below.
; open icon in exe file. exe_icon = shell32_ExtractIcon(kernel32_GetModuleHandle(0),"test.exe",0) ; create window. window = CreateWindow("test icon example",200,200,400,300,0,11) panel = CreatePanel(10,10,200,200,window) ; get the panels device context window_hdc = user32_GetDC(QueryObject(panel ,1)) exe_icon_1 = shell32_ExtractIcon(kernel32_GetModuleHandle(0),"test2.exe",0) ; draw icon. user32_DrawIcon window_hdc,100,10,exe_icon_1 MouseWait FreeGadget panel panel = CreatePanel(10,10,200,200,window) ; get the panels device context window_hdc = user32_GetDC(QueryObject(panel ,1)) ; draw icon. user32_DrawIcon window_hdc,100,10,exe_icon ; wait until the user closes one of the windows Repeat If WaitEvent()=$803 Then Exit Forever ; free icon. If exe_icon > 0 Then user32_DestroyIcon exe_icon EndIf ; free icon. If exe_icon_1 > 0 Then user32_DestroyIcon exe_icon_1 EndIf End
some information on device contexts found on msdn
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_0g6r.asp
kev