mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 12:54:51 +00:00
[USER32]
* Fix wrong array length passed to GetClassNameW. CID 716222 * Replace other instances of explicit array length to GetWindowTextW with _countof(x). Based on a patch by Christoph von Wittich. svn path=/branches/shell-experiments/; revision=64866
This commit is contained in:
parent
9abc368186
commit
a44f907d52
|
@ -83,7 +83,7 @@ void CompleteSwitch(BOOL doSwitch)
|
||||||
{
|
{
|
||||||
HWND hwnd = windowList[selectedWindow];
|
HWND hwnd = windowList[selectedWindow];
|
||||||
|
|
||||||
GetWindowTextW(hwnd, windowText, 1023);
|
GetWindowTextW(hwnd, windowText, _countof(windowText));
|
||||||
|
|
||||||
TRACE("[ATbot] CompleteSwitch Switching to 0x%08x (%ls)\n", hwnd, windowText);
|
TRACE("[ATbot] CompleteSwitch Switching to 0x%08x (%ls)\n", hwnd, windowText);
|
||||||
|
|
||||||
|
@ -103,9 +103,9 @@ BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
||||||
if (!IsWindowVisible(window))
|
if (!IsWindowVisible(window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
GetClassNameW(window,windowText,4095);
|
GetClassNameW(window, windowText, _countof(windowText));
|
||||||
if ((wcscmp(L"Shell_TrayWnd",windowText)==0) ||
|
if ((wcscmp(L"Shell_TrayWnd", windowText)==0) ||
|
||||||
(wcscmp(L"Progman",windowText)==0) )
|
(wcscmp(L"Progman", windowText)==0) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
// First try to get the big icon assigned to the window
|
// First try to get the big icon assigned to the window
|
||||||
|
@ -194,7 +194,7 @@ void OnPaint(HWND hWnd)
|
||||||
HPEN hPen;
|
HPEN hPen;
|
||||||
HFONT dcFont;
|
HFONT dcFont;
|
||||||
COLORREF cr;
|
COLORREF cr;
|
||||||
int nch = GetWindowTextW(windowList[selectedWindow], windowText, 1023);
|
int nch = GetWindowTextW(windowList[selectedWindow], windowText, _countof(windowText));
|
||||||
|
|
||||||
dialogDC = BeginPaint(hWnd, &paint);
|
dialogDC = BeginPaint(hWnd, &paint);
|
||||||
{
|
{
|
||||||
|
@ -373,7 +373,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
}
|
}
|
||||||
TRACE("DoAppSwitch VK_ESCAPE 1 Count %d windowCount %d\n",Count,windowCount);
|
TRACE("DoAppSwitch VK_ESCAPE 1 Count %d windowCount %d\n",Count,windowCount);
|
||||||
hwnd = windowList[Count];
|
hwnd = windowList[Count];
|
||||||
GetWindowTextW(hwnd, Text, 1023);
|
GetWindowTextW(hwnd, Text, _countof(Text));
|
||||||
TRACE("[ATbot] Switching to 0x%08x (%ls)\n", hwnd, Text);
|
TRACE("[ATbot] Switching to 0x%08x (%ls)\n", hwnd, Text);
|
||||||
MakeWindowActive(hwnd);
|
MakeWindowActive(hwnd);
|
||||||
Esc = TRUE;
|
Esc = TRUE;
|
||||||
|
@ -456,7 +456,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
Count = windowCount - 1;
|
Count = windowCount - 1;
|
||||||
}
|
}
|
||||||
hwnd = windowList[Count];
|
hwnd = windowList[Count];
|
||||||
GetWindowTextW(hwnd, Text, 1023);
|
GetWindowTextW(hwnd, Text, _countof(Text));
|
||||||
MakeWindowActive(hwnd);
|
MakeWindowActive(hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue