This commit is contained in:
spx 2011-04-19 01:20:17 +00:00
parent 2a030c084c
commit 4aafa49a28

View File

@ -552,10 +552,11 @@ HWND CSystem::GetDefaultShellWindow()
if (ShellW) if (ShellW)
{ {
HWND hwnd = NULL; WCHAR className[16];
while (hwnd = FindWindowEx(NULL, hwnd, L"Progman", NULL)) if (GetClassName(ShellW, className, 16) > 0 &&
_wcsicmp(className, L"Progman") == 0)
{ {
if (hwnd == ShellW) return ShellW; return ShellW;
} }
} }
@ -667,10 +668,10 @@ bool CSystem::BelongToSameProcess(HWND hwndA, HWND hwndB)
BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam) BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
{ {
bool logging = CRainmeter::GetDebug() && DEBUG_VERBOSE; bool logging = CRainmeter::GetDebug() && DEBUG_VERBOSE;
WCHAR className[128] = {0}; WCHAR className[64];
CMeterWindow* Window; CMeterWindow* Window;
if (GetClassName(hwnd, className, 128) > 0 && if (GetClassName(hwnd, className, 64) > 0 &&
wcscmp(className, METERWINDOW_CLASS_NAME) == 0 && wcscmp(className, METERWINDOW_CLASS_NAME) == 0 &&
Rainmeter && (Window = Rainmeter->GetMeterWindow(hwnd))) Rainmeter && (Window = Rainmeter->GetMeterWindow(hwnd)))
{ {
@ -771,12 +772,12 @@ void CSystem::PrepareHelperWindow(HWND WorkerW)
{ {
if (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) if (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
{ {
WCHAR className[128], windowText[128]; WCHAR className[64], windowText[64];
if (logging) if (logging)
{ {
GetClassName(hwnd, className, 128); GetClassName(hwnd, className, 64);
GetWindowText(hwnd, windowText, 128); GetWindowText(hwnd, windowText, 64);
} }
// Insert the helper window after the found window // Insert the helper window after the found window
@ -860,9 +861,9 @@ void CALLBACK CSystem::MyWinEventProc(HWINEVENTHOOK hWinEventHook, DWORD event,
{ {
if (!c_ShowDesktop) if (!c_ShowDesktop)
{ {
WCHAR className[128]; WCHAR className[16];
if (GetClassName(hwnd, className, 128) > 0 && if (GetClassName(hwnd, className, 16) > 0 &&
wcscmp(className, L"WorkerW") == 0 && _wcsicmp(className, L"WorkerW") == 0 &&
hwnd == GetWorkerW()) hwnd == GetWorkerW())
{ {
CheckDesktopState(hwnd); CheckDesktopState(hwnd);