Und wie kann ich systray icons in die exe mit einfügen?
thx

Wichtig: ein Return am ende und falls Pfad angegeben, immer mit doppeltenIcon.rc hat geschrieben:100 ICON "C:\\WINDOWS\\TEMP\\Icon.ico"
Code: Alles auswählen
Import "Icon.res" : EndImport
hIcon = LoadIcon_(GetModuleHandle_(#NUL), 100)
Code: Alles auswählen
AddSysTrayIcon(#SysTrayIcon, WindowID(0), hIcon1)
Code: Alles auswählen
ChangeSysTrayIcon(#SysTrayIcon, hIcon2)
Code: Alles auswählen
[ERROR] 'ImageID' is null !
Code: Alles auswählen
Import "Icon.res" : EndImport
If hsIcon1 = LoadIcon_(GetModuleHandle_(#NUL), 100)
Debug "geladen1"
EndIf
If hsIcon2 = LoadIcon_(GetModuleHandle_(#NUL), 101)
Debug "geladen2"
EndIf
Enumeration
#Window_0
#Menu_New
#Menu_Open
#Menu_Save
#Menu_Exit
#POPUP_MENU
#SysTrayIcon
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 275, 10, 100, 0, "Chatstatus", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
EndIf
EndIf
EndProcedure
InitNetwork()
Open_Window_0()
HideWindow(#Window_0, 1)
CreatePopupMenu(#POPUP_MENU)
MenuItem(#Menu_Exit, "Be&enden")
AddSysTrayIcon(#SysTrayIcon, WindowID(#Window_0), hsIcon1)
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
Menu = EventMenu()
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
If Event = #PB_Event_Gadget
EndIf
If Event = #PB_Event_Menu
Select Menu
Case #Menu_Exit
Exit = 1
EndSelect
EndIf
If Event = #PB_Event_SysTray
Select EventType
Case #PB_EventType_LeftClick ;Klick mit der linken Maustaste
ChangeSysTrayIcon(#SysTrayIcon, #ico1)
Case #PB_EventType_RightClick ; Klick mit der rechten Maustaste
DisplayPopupMenu(#POPUP_MENU, WindowID(#Window_0)) ; Menuaufruf
EndSelect
EndIf
Until Exit
End
Code: Alles auswählen
100 ICON "C:\\chatdead.ico"
101 ICON "C:\\chatalive.ico"
Code: Alles auswählen
Import "Icon.res" : EndImport
hsIcon1 = LoadIcon_(GetModuleHandle_(#NUL), 100)
hsIcon2 = LoadIcon_(GetModuleHandle_(#NUL), 101)
If (Not hsIcon1) Or (Not hsIcon2)
Debug "No Icon"
End
EndIf