diff --git a/Application/Application.cpp b/Application/Application.cpp index 945a7db8..f6b775ca 100644 --- a/Application/Application.cpp +++ b/Application/Application.cpp @@ -145,7 +145,7 @@ BOOL InitApplication(HINSTANCE hInstance, const WCHAR* WinClass) wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_RAINMETER)); + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_RAINMETER)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; diff --git a/Library/AboutDialog.cpp b/Library/AboutDialog.cpp index ad111321..1bec915b 100644 --- a/Library/AboutDialog.cpp +++ b/Library/AboutDialog.cpp @@ -43,6 +43,12 @@ HWND OpenAboutDialog(HWND hwndOwner, HINSTANCE instance) if (g_DialogWin == NULL) { g_DialogWin = CreateDialog(instance, MAKEINTRESOURCE(IDD_ABOUT_DIALOG), hwndOwner, AboutProc); + + if (g_DialogWin) + { + HICON hIcon = LoadIcon(instance, MAKEINTRESOURCE(IDI_TRAY)); + SendMessage(g_DialogWin, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); + } } ShowWindow(g_DialogWin, SW_SHOWNORMAL); UpdateAboutStatistics(); diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 7ba27d32..9b476af1 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -878,10 +878,6 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } break; - case BANG_ABOUT: - OpenAboutDialog(m_Window, m_Rainmeter->GetInstance()); - break; - case BANG_MOVEMETER: pos = wcschr(arg, ' '); if (pos != NULL) diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 80ecada3..8bbd14e6 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -126,7 +126,6 @@ enum BANGCOMMAND BANG_DISABLEMEASUREGROUP, BANG_LSHOOK, - BANG_ABOUT, BANG_PLUGIN, BANG_SETVARIABLE }; diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index c4fd727b..bdb79acd 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -937,7 +937,10 @@ void RainmeterLsHook(HWND, const char* arg) */ void RainmeterAbout(HWND, const char* arg) { - BangWithArgs(BANG_ABOUT, ConvertToWide(arg).c_str(), 0); + if (Rainmeter) + { + OpenAboutDialog(Rainmeter->GetTrayWindow()->GetWindow(), Rainmeter->GetInstance()); + } } /* @@ -2282,7 +2285,6 @@ void CRainmeter::ScanForThemes(std::wstring& path) void CRainmeter::SaveSettings() { - // Just one setting for writing at the moment WritePrivateProfileString(L"Rainmeter", L"CheckUpdate", NULL , m_IniFile.c_str()); WritePrivateProfileString(L"Rainmeter", L"DisableVersionCheck", m_DisableVersionCheck ? L"1" : L"0" , m_IniFile.c_str()); } @@ -2487,7 +2489,7 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg, } else if (wcsicmp(bang.c_str(), L"!RainmeterAbout") == 0) { - BangWithArgs(BANG_ABOUT, arg.c_str(), 0); + RainmeterAbout(NULL, NULL); } else if (wcsicmp(bang.c_str(), L"!RainmeterSkinMenu") == 0) { diff --git a/Library/TrayWindow.cpp b/Library/TrayWindow.cpp index 8fa0c17a..778b72e3 100644 --- a/Library/TrayWindow.cpp +++ b/Library/TrayWindow.cpp @@ -47,7 +47,7 @@ CTrayWindow::CTrayWindow(HINSTANCE instance) wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = instance; - wc.hIcon = NULL; + wc.hIcon = LoadIcon(instance, MAKEINTRESOURCE(IDI_TRAY)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL;