From ec8550d58766f62777e8cfbab9d0eb3954c82d1b Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 8 Mar 2016 21:18:48 -0500 Subject: [PATCH] use ictoopie_16 in tray --- Win32/Resource.rc | 2 +- Win32/Win32App.cpp | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Win32/Resource.rc b/Win32/Resource.rc index c8643e8d..56868181 100644 --- a/Win32/Resource.rc +++ b/Win32/Resource.rc @@ -53,7 +53,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. MAINICON ICON "ictoopie.ico" - +IDI_ICON1 ICON "ictoopie_16.ico" #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/Win32/Win32App.cpp b/Win32/Win32App.cpp index b039c9b3..c356aec5 100644 --- a/Win32/Win32App.cpp +++ b/Win32/Win32App.cpp @@ -42,18 +42,7 @@ void AddTrayIcon (HWND hWnd) nid.uID = ID_TRAY_ICON; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_TRAYICON; - // TODO: must set correct icon - // 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 ); - } + nid.hIcon = LoadIcon (GetModuleHandle(NULL), MAKEINTRESOURCE (IDI_ICON1)); strcpy (nid.szTip, "i2pd"); 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.cbWndExtra = 0; wclx.hInstance = hInst; - wclx.hIcon = LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)); - wclx.hIconSm = LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)); + wclx.hIcon = LoadIcon (hInst, IDI_APPLICATION); + wclx.hIconSm = LoadIcon (hInst, IDI_APPLICATION); wclx.hCursor = LoadCursor (NULL, IDC_ARROW); wclx.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wclx.lpszMenuName = NULL;