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
| ||
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. |
| ||
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. |
| ||
You could use ggTray from the code archives. I use it. |
| ||
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": |