Some .exe example for minimizing to sys. tray. that I made
in purebasic ( look at the attached file ) , and here's the purebasic code if it helps ...
If OpenWindow(0, 100, 150, 300, 100, "Sys. tray example by FrEaK-sK8", #PB_Window_SystemMenu)
HideWindow(0,1)
MessageRequester("Test!","Welcome to my test program!")
If CreateGadgetList(WindowID(0))
EndIf
ButtonGadget(1,50,20,200,30,"Minimize to sys. tray.")
AddSysTrayIcon(1, WindowID(0), LoadImage(0, "DataCdPlayer.ico"))
SysTrayIconToolTip(1, "Thats me!")
Repeat
Event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case 1
MessageRequester("Info!","Minimize to sys. tray now...") : HideWindow(0,1)
EndSelect
EndSelect
Event = WaitWindowEvent()
If Event = #PB_Event_SysTray
If EventType() = #PB_EventType_LeftDoubleClick
MessageRequester("SysTray", "Maximize now... ",0)
ChangeSysTrayIcon (EventGadget(), LoadImage(0, "CdPlayer.ico"))
HideWindow(0,0)
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
EDIT: sry ... forgot to attach the icon needed for file ( i putt it all in .rar file now
EDIT2: Updated again... Now it should work..
Sk8 or Die madafaka