mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 08:51:29 +00:00
[USER32] Fix GetWindowTextLength() blocking call using the same technique as in GetWindowText(). Fix indentation in GetWindowText().
This commit is contained in:
parent
69acbe905a
commit
68430db462
|
@ -1319,7 +1319,9 @@ GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
|
|||
_SEH2_END;
|
||||
}
|
||||
else
|
||||
{
|
||||
Length = SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString);
|
||||
}
|
||||
//ERR("GWTA Len %d : %s\n",Length,lpString);
|
||||
return Length;
|
||||
}
|
||||
|
@ -1330,7 +1332,20 @@ GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
|
|||
int WINAPI
|
||||
GetWindowTextLengthA(HWND hWnd)
|
||||
{
|
||||
return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
|
||||
PWND Wnd;
|
||||
|
||||
Wnd = ValidateHwnd(hWnd);
|
||||
if (!Wnd)
|
||||
return 0;
|
||||
|
||||
if (!TestWindowProcess(Wnd))
|
||||
{
|
||||
return DefWindowProcA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1339,7 +1354,20 @@ GetWindowTextLengthA(HWND hWnd)
|
|||
int WINAPI
|
||||
GetWindowTextLengthW(HWND hWnd)
|
||||
{
|
||||
return(SendMessageW(hWnd, WM_GETTEXTLENGTH, 0, 0));
|
||||
PWND Wnd;
|
||||
|
||||
Wnd = ValidateHwnd(hWnd);
|
||||
if (!Wnd)
|
||||
return 0;
|
||||
|
||||
if (!TestWindowProcess(Wnd))
|
||||
{
|
||||
return DefWindowProcW(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return SendMessageW(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1373,7 +1401,9 @@ GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
|
|||
_SEH2_END;
|
||||
}
|
||||
else
|
||||
{
|
||||
Length = SendMessageW(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString);
|
||||
}
|
||||
//ERR("GWTW Len %d : %S\n",Length,lpString);
|
||||
return Length;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue