Minimize Prg to tray and get the icon of an .exe

BlitzPlus Forums/BlitzPlus Programming/Minimize Prg to tray and get the icon of an .exe

Starwar(Posted 2007) [#1]
G´day. I have two problems:
1) I wanna minimize a programm to the tray.
2) I wanna get the icon of an .exe-File
Any ideas?
Thank you.


SebHoll(Posted 2007) [#2]
I can point to some info about getting the icon of an EXE. I asked the same question a few years ago:

http://www.blitzbasic.com/Community/posts.php?topic=46086#513243

Other than that, I don't think I'll be much help as I have been using BlitzMax since then.


Ked(Posted 2007) [#3]
You could use ggTray from the code archives. I use it.


Andres(Posted 2007) [#4]
Uses ggTray + shell32.dll + user32.dll.

Get icon from exe:
ggTrayCreate(QueryObject(Window, 1))
ggTraySetIconFromHandle(api_ExtractIconA(QueryObject(MainWindow%, 1), "your.exe", 0))
SetTrayTip()
ggTrayShowIcon()


If you minimize your window then you need to
ggTrayShowIcon()
HideGadget(Window%)

else
ShowGadget(Window%)
api_ShowWindow(api_GetActiveWindow(), 9) ; To restore from being minimized
ggTrayHideIcon()


userlib "shell32.decls":
.lib "shell32.dll"
api_ExtractIconA%(hWnd%,File$,Index%):"ExtractIconA"


userlib "user32.decls":