Browse Source

use ictoopie_16 in tray

pull/407/head
orignal 9 years ago
parent
commit
ec8550d587
  1. 2
      Win32/Resource.rc
  2. 17
      Win32/Win32App.cpp

2
Win32/Resource.rc

@ -53,7 +53,7 @@ END
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
MAINICON ICON "ictoopie.ico" MAINICON ICON "ictoopie.ico"
IDI_ICON1 ICON "ictoopie_16.ico"
#endif // English (United States) resources #endif // English (United States) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

17
Win32/Win32App.cpp

@ -42,18 +42,7 @@ void AddTrayIcon (HWND hWnd)
nid.uID = ID_TRAY_ICON; nid.uID = ID_TRAY_ICON;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_TRAYICON; nid.uCallbackMessage = WM_TRAYICON;
// TODO: must set correct icon nid.hIcon = LoadIcon (GetModuleHandle(NULL), MAKEINTRESOURCE (IDI_ICON1));
// nid.hIcon = LoadIcon (GetModuleHandle(NULL), MAKEINTRESOURCE (IDI_ICON1));
{
char szIconFile[512];
GetSystemDirectory( szIconFile, sizeof( szIconFile ) );
if ( szIconFile[ strlen( szIconFile ) - 1 ] != '\\' )
strcat( szIconFile, "\\" );
strcat( szIconFile, "shell32.dll" );
// Icon #23 (0-indexed) in shell32.dll is a "help" icon.
ExtractIconEx( szIconFile, 23, NULL, &(nid.hIcon), 1 );
}
strcpy (nid.szTip, "i2pd"); strcpy (nid.szTip, "i2pd");
Shell_NotifyIcon(NIM_ADD, &nid ); Shell_NotifyIcon(NIM_ADD, &nid );
} }
@ -134,8 +123,8 @@ static LRESULT CALLBACK WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
wclx.cbClsExtra = 0; wclx.cbClsExtra = 0;
wclx.cbWndExtra = 0; wclx.cbWndExtra = 0;
wclx.hInstance = hInst; wclx.hInstance = hInst;
wclx.hIcon = LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)); wclx.hIcon = LoadIcon (hInst, IDI_APPLICATION);
wclx.hIconSm = LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)); wclx.hIconSm = LoadIcon (hInst, IDI_APPLICATION);
wclx.hCursor = LoadCursor (NULL, IDC_ARROW); wclx.hCursor = LoadCursor (NULL, IDC_ARROW);
wclx.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wclx.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wclx.lpszMenuName = NULL; wclx.lpszMenuName = NULL;

Loading…
Cancel
Save