Could anyone provide me with a link or an example of a Win32 application that you can minimize to the system tray? Everything I've found requires MFC or it's for Visual Studio 2003 and it doesn't seem to work in Visual Studio 2005. Also, it needs to be in either C or C++.
Thanks in advance for any replies.
Look in MSDN.
Specifically, look up Shell_NotifyIcon().
1 | NOTIFYICONDATA nid; |
2 | nid.cbSize = sizeof(NOTIFYICONDATA); |
3 | nid.hWnd = win_get_window(); |
4 | nid.uID = 0; |
5 | nid.uFlags = NIF_ICON | NIF_TIP; |
6 | nid.uCallbackMessage = 0; |
7 | char tmp[256]; |
8 | get_executable_name(tmp, 256); |
9 | HMODULE hMod = GetModuleHandle(tmp); |
10 | if ( NULL == hMod ) |
11 | log << "failed to GetModuleHandle() "; |
12 | else |
13 | { |
14 | HICON hIco = LoadIcon( hMod, "ALLEGRO_ICON"); |
15 | if ( NULL == hIco ) |
16 | log << "failed to LoadIcon()"; |
17 | else |
18 | { |
19 | nid.hIcon = hIco; |
20 | strncpy( nid.szTip, "Your app Name", 64 ); |
21 | if ( false == Shell_NotifyIcon( NIM_ADD, &nid )) |
22 | log << "failed to Shell_NotifyIcon()"; |
23 | } |
24 | } |
Great, thanks A J. Hopefully between a few Win32 tutorials I finally found and what you gave me, this will work.