diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index e1e3c088..7a274b6f 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -782,11 +782,11 @@ int CRainmeter::Initialize(LPCWSTR iniPath) wc.lpfnWndProc = (WNDPROC)MainWndProc; wc.hInstance = m_Instance; wc.lpszClassName = RAINMETER_CLASS_NAME; - RegisterClass(&wc); + ATOM className = RegisterClass(&wc); m_Window = CreateWindowEx( WS_EX_TOOLWINDOW, - RAINMETER_CLASS_NAME, + MAKEINTATOM(className), RAINMETER_WINDOW_NAME, WS_POPUP | WS_DISABLED, CW_USEDEFAULT, diff --git a/Library/System.cpp b/Library/System.cpp index 60b7ae4a..779d297f 100644 --- a/Library/System.cpp +++ b/Library/System.cpp @@ -68,14 +68,13 @@ void CSystem::Initialize(HINSTANCE instance) WNDCLASS wc = {0}; wc.lpfnWndProc = (WNDPROC)WndProc; wc.hInstance = instance; - wc.lpszClassName = L"RainmeterSystemClass"; - - RegisterClass(&wc); + wc.lpszClassName = L"RainmeterSystem"; + ATOM className = RegisterClass(&wc); c_Window = CreateWindowEx( WS_EX_TOOLWINDOW, - L"RainmeterSystemClass", - L"SystemWindow", + MAKEINTATOM(className), + L"System", WS_POPUP | WS_DISABLED, CW_USEDEFAULT, CW_USEDEFAULT, @@ -88,8 +87,8 @@ void CSystem::Initialize(HINSTANCE instance) c_HelperWindow = CreateWindowEx( WS_EX_TOOLWINDOW, - L"RainmeterSystemClass", - L"PositioningHelperWindow", + MAKEINTATOM(className), + L"PositioningHelper", WS_POPUP | WS_DISABLED, CW_USEDEFAULT, CW_USEDEFAULT, @@ -875,7 +874,7 @@ bool CSystem::CheckDesktopState(HWND WorkerW) if (WorkerW && IsWindowVisible(WorkerW)) { - hwnd = FindWindowEx(NULL, WorkerW, L"RainmeterSystemClass", L"SystemWindow"); + hwnd = FindWindowEx(NULL, WorkerW, L"RainmeterSystem", L"System"); } bool stateChanged = (hwnd && !c_ShowDesktop) || (!hwnd && c_ShowDesktop);