3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS user32.dll
5 * FILE: lib/user32/windows/window.c
6 * PURPOSE: Window management
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * 06-06-2001 CSH Created
12 /* INCLUDES ******************************************************************/
18 #include <user32/callback.h>
19 #include <user32/regcontrol.h>
23 BOOL ControlsInitialized
= FALSE
;
25 LRESULT
DefWndNCPaint(HWND hWnd
, HRGN hRgn
);
27 /* FUNCTIONS *****************************************************************/
31 User32CallSendAsyncProcForKernel(PVOID Arguments
, ULONG ArgumentLength
)
33 PSENDASYNCPROC_CALLBACK_ARGUMENTS CallbackArgs
;
35 DPRINT("User32CallSendAsyncProcKernel()\n");
36 CallbackArgs
= (PSENDASYNCPROC_CALLBACK_ARGUMENTS
)Arguments
;
37 if (ArgumentLength
!= sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
))
39 return(STATUS_INFO_LENGTH_MISMATCH
);
41 CallbackArgs
->Callback(CallbackArgs
->Wnd
, CallbackArgs
->Msg
,
42 CallbackArgs
->Context
, CallbackArgs
->Result
);
43 return(STATUS_SUCCESS
);
51 AllowSetForegroundWindow(DWORD dwProcessId
)
62 ArrangeIconicWindows(HWND hWnd
)
73 BeginDeferWindowPos(int nNumWindows
)
88 BringWindowToTop(HWND hWnd
)
90 return NtUserSetWindowPos( hWnd
,
96 SWP_NOSIZE
| SWP_NOMOVE
);
105 CascadeWindows(HWND hwndParent,
118 SwitchToThisWindow ( HWND hwnd
, BOOL fUnknown
)
120 ShowWindow ( hwnd
, SW_SHOW
);
127 ChildWindowFromPoint(HWND hWndParent
,
130 return (HWND
) NtUserChildWindowFromPointEx(hWndParent
, Point
.x
, Point
.y
, 0);
138 ChildWindowFromPointEx(HWND hwndParent
,
142 return (HWND
) NtUserChildWindowFromPointEx(hwndParent
, pt
.x
, pt
.y
, uFlags
);
150 CloseWindow(HWND hWnd
)
152 SendMessageA(hWnd
, WM_SYSCOMMAND
, SC_CLOSE
, 0);
161 CreateWindowExA(DWORD dwExStyle
,
174 UNICODE_STRING WindowName
;
175 UNICODE_STRING ClassName
;
180 DbgPrint("[window] CreateWindowExA style %d, exstyle %d, parent %d\n", dwStyle
, dwExStyle
, hWndParent
);
183 if (IS_ATOM(lpClassName
))
185 RtlInitUnicodeString(&ClassName
, NULL
);
186 ClassName
.Buffer
= (LPWSTR
)lpClassName
;
190 if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName
), (PCSZ
)lpClassName
))
192 SetLastError(ERROR_OUTOFMEMORY
);
197 /* Register built-in controls if not already done */
198 if (! ControlsInitialized
)
200 ControlsInitialized
= ControlsInit(ClassName
.Buffer
);
203 if (dwExStyle
& WS_EX_MDICHILD
)
205 if (!IS_ATOM(lpClassName
))
206 RtlFreeUnicodeString(&ClassName
);
207 return CreateMDIWindowA(lpClassName
, lpWindowName
, dwStyle
, x
, y
,
208 nWidth
, nHeight
, hWndParent
, hInstance
, (LPARAM
)lpParam
);
211 if (!RtlCreateUnicodeStringFromAsciiz(&WindowName
, (PCSZ
)lpWindowName
))
213 if (!IS_ATOM(lpClassName
))
215 RtlFreeUnicodeString(&ClassName
);
217 SetLastError(ERROR_OUTOFMEMORY
);
221 if(!hMenu
&& (dwStyle
& (WS_OVERLAPPEDWINDOW
| WS_POPUP
)))
223 wce
.cbSize
= sizeof(WNDCLASSEXA
);
224 if(GetClassInfoExA(hInstance
, lpClassName
, &wce
) && wce
.lpszMenuName
)
226 hMenu
= LoadMenuA(hInstance
, wce
.lpszMenuName
);
230 Handle
= NtUserCreateWindowEx(dwExStyle
,
246 DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle
);
249 RtlFreeUnicodeString(&WindowName
);
251 if (!IS_ATOM(lpClassName
))
253 RtlFreeUnicodeString(&ClassName
);
264 CreateWindowExW(DWORD dwExStyle
,
266 LPCWSTR lpWindowName
,
277 UNICODE_STRING WindowName
;
278 UNICODE_STRING ClassName
;
282 /* Register built-in controls if not already done */
283 if (! ControlsInitialized
)
285 ControlsInitialized
= ControlsInit(lpClassName
);
288 if (dwExStyle
& WS_EX_MDICHILD
)
289 return CreateMDIWindowW(lpClassName
, lpWindowName
, dwStyle
, x
, y
,
290 nWidth
, nHeight
, hWndParent
, hInstance
, (LPARAM
)lpParam
);
292 if (IS_ATOM(lpClassName
))
294 RtlInitUnicodeString(&ClassName
, NULL
);
295 ClassName
.Buffer
= (LPWSTR
)lpClassName
;
299 RtlInitUnicodeString(&ClassName
, lpClassName
);
302 RtlInitUnicodeString(&WindowName
, lpWindowName
);
304 if(!hMenu
&& (dwStyle
& (WS_OVERLAPPEDWINDOW
| WS_POPUP
)))
306 wce
.cbSize
= sizeof(WNDCLASSEXW
);
307 if(GetClassInfoExW(hInstance
, lpClassName
, &wce
) && wce
.lpszMenuName
)
309 hMenu
= LoadMenuW(hInstance
, wce
.lpszMenuName
);
313 Handle
= NtUserCreateWindowEx(dwExStyle
,
336 DeferWindowPos(HDWP hWinPosInfo
,
338 HWND hWndInsertAfter
,
346 return NtUserDeferWindowPos(hWinPosInfo
, hWnd
, hWndInsertAfter
, x
, y
, cx
, cy
, uFlags
);
348 SetWindowPos(hWnd
, hWndInsertAfter
, x
, y
, cx
, cy
, uFlags
);
358 DestroyWindow(HWND hWnd
)
360 return NtUserDestroyWindow(hWnd
);
368 EndDeferWindowPos(HDWP hWinPosInfo
)
383 GetDesktopWindow(VOID
)
385 return NtUserGetDesktopWindow();
393 GetForegroundWindow(VOID
)
395 return NtUserGetForegroundWindow();
404 ENUMWINDOWSPROC lpfn
,
409 DWORD i
, dwCount
= 0;
415 SetLastError ( ERROR_INVALID_PARAMETER
);
419 /* FIXME instead of always making two calls, should we use some
420 sort of persistent buffer and only grow it ( requiring a 2nd
421 call ) when the buffer wasn't already big enough? */
422 /* first get how many window entries there are */
424 dwCount
= NtUserBuildHwndList (
425 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, NULL
, 0 );
426 if ( !dwCount
|| GetLastError() )
429 /* allocate buffer to receive HWND handles */
430 hHeap
= GetProcessHeap();
431 pHwnd
= HeapAlloc ( hHeap
, 0, sizeof(HWND
)*(dwCount
+1) );
434 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
438 /* now call kernel again to fill the buffer this time */
439 dwCount
= NtUserBuildHwndList (
440 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, pHwnd
, dwCount
);
441 if ( !dwCount
|| GetLastError() )
444 HeapFree ( hHeap
, 0, pHwnd
);
448 /* call the user's callback function until we're done or
449 they tell us to quit */
450 for ( i
= 0; i
< dwCount
; i
++ )
452 /* FIXME I'm only getting NULLs from Thread Enumeration, and it's
453 * probably because I'm not doing it right in NtUserBuildHwndList.
454 * Once that's fixed, we shouldn't have to check for a NULL HWND
457 if ( !(ULONG
)pHwnd
[i
] ) /* don't enumerate a NULL HWND */
459 if ( !(*lpfn
)( pHwnd
[i
], lParam
) )
461 HeapFree ( hHeap
, 0, pHwnd
);
466 HeapFree ( hHeap
, 0, pHwnd
);
478 ENUMWINDOWSPROC lpEnumFunc
,
482 hWndParent
= GetDesktopWindow();
483 return User32EnumWindows ( NULL
, hWndParent
, lpEnumFunc
, lParam
, 0, FALSE
);
492 EnumThreadWindows(DWORD dwThreadId
,
493 ENUMWINDOWSPROC lpfn
,
497 dwThreadId
= GetCurrentThreadId();
498 return User32EnumWindows ( NULL
, NULL
, lpfn
, lParam
, dwThreadId
, FALSE
);
506 EnumWindows(ENUMWINDOWSPROC lpEnumFunc
,
509 return User32EnumWindows ( NULL
, NULL
, lpEnumFunc
, lParam
, 0, FALSE
);
520 ENUMWINDOWSPROC lpfn
,
523 return User32EnumWindows ( hDesktop
, NULL
, lpfn
, lParam
, 0, FALSE
);
531 FindWindowExA(HWND hwndParent
,
536 UNICODE_STRING ucClassName
;
537 UNICODE_STRING ucWindowName
;
540 if (lpszClass
== NULL
)
542 ucClassName
.Buffer
= NULL
;
543 ucClassName
.Length
= 0;
545 else if (IS_ATOM(lpszClass
))
547 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
548 ucClassName
.Length
= 0;
552 RtlCreateUnicodeStringFromAsciiz(&ucClassName
, (LPSTR
)lpszClass
);
555 RtlCreateUnicodeStringFromAsciiz(&ucWindowName
, (LPSTR
)lpszWindow
);
557 Result
= NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
,
560 if (!IS_ATOM(lpszClass
))
561 RtlFreeUnicodeString(&ucClassName
);
562 RtlFreeUnicodeString(&ucWindowName
);
572 FindWindowExW(HWND hwndParent
,
577 UNICODE_STRING ucClassName
;
578 UNICODE_STRING ucWindowName
;
580 if (lpszClass
== NULL
)
582 ucClassName
.Buffer
= NULL
;
583 ucClassName
.Length
= 0;
585 else if (IS_ATOM(lpszClass
))
587 RtlInitUnicodeString(&ucClassName
, NULL
);
588 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
592 RtlInitUnicodeString(&ucClassName
, lpszClass
);
595 RtlInitUnicodeString(&ucWindowName
, lpszWindow
);
597 return NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
, &ucWindowName
);
605 FindWindowA(LPCSTR lpClassName
, LPCSTR lpWindowName
)
607 //FIXME: FindWindow does not search children, but FindWindowEx does.
608 // what should we do about this?
609 return FindWindowExA (NULL
, NULL
, lpClassName
, lpWindowName
);
617 FindWindowW(LPCWSTR lpClassName
, LPCWSTR lpWindowName
)
621 There was a FIXME here earlier, but I think it is just a documentation unclarity.
623 FindWindow only searches top level windows. What they mean is that child
624 windows of other windows than the desktop can be searched.
625 FindWindowExW never does a recursive search.
630 return FindWindowExW (NULL
, NULL
, lpClassName
, lpWindowName
);
639 GetAltTabInfoA(HWND hwnd
,
654 GetAltTabInfoW(HWND hwnd
,
669 GetAncestor(HWND hwnd
, UINT gaFlags
)
671 return(NtUserGetAncestor(hwnd
, gaFlags
));
679 GetClientRect(HWND hWnd
, LPRECT lpRect
)
681 return(NtUserGetClientRect(hWnd
, lpRect
));
689 GetGUIThreadInfo(DWORD idThread
,
690 LPGUITHREADINFO lpgui
)
692 return (BOOL
)NtUserGetGUIThreadInfo(idThread
, lpgui
);
700 GetLastActivePopup(HWND hWnd
)
702 return NtUserGetLastActivePopup(hWnd
);
712 return NtUserGetParent(hWnd
);
720 GetProcessDefaultLayout(DWORD
*pdwDefaultLayout
)
731 GetTitleBarInfo(HWND hwnd
,
746 return NtUserGetWindow(hWnd
, uCmd
);
754 GetTopWindow(HWND hWnd
)
756 if (!hWnd
) hWnd
= GetDesktopWindow();
757 return GetWindow( hWnd
, GW_CHILD
);
765 GetWindowInfo(HWND hwnd
,
768 return NtUserGetWindowInfo(hwnd
, pwi
);
776 GetWindowModuleFileNameA(HWND hwnd
,
782 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
787 return GetModuleFileNameA(hWndInst
, lpszFileName
, cchFileNameMax
);
795 GetWindowModuleFileNameW(HWND hwnd
,
801 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
806 return GetModuleFileNameW(hWndInst
, lpszFileName
, cchFileNameMax
);
814 GetWindowPlacement(HWND hWnd
,
815 WINDOWPLACEMENT
*lpwndpl
)
817 return (BOOL
)NtUserGetWindowPlacement(hWnd
, lpwndpl
);
825 GetWindowRect(HWND hWnd
,
828 return(NtUserGetWindowRect(hWnd
, lpRect
));
836 GetWindowTextA(HWND hWnd
, LPSTR lpString
, int nMaxCount
)
839 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
844 if(ProcessId
!= GetCurrentProcessId())
846 /* do not send WM_GETTEXT messages to other processes */
852 *((PWSTR
)lpString
) = '\0';
854 Buffer
= HeapAlloc(GetProcessHeap(), 0, nMaxCount
* sizeof(WCHAR
));
857 Length
= NtUserInternalGetWindowText(hWnd
, Buffer
, nMaxCount
);
858 if (Length
> 0 && nMaxCount
> 0 &&
859 !WideCharToMultiByte(CP_ACP
, 0, Buffer
, -1,
860 lpString
, nMaxCount
, NULL
, NULL
))
865 HeapFree(GetProcessHeap(), 0, Buffer
);
867 return (LRESULT
)Length
;
870 return(SendMessageA(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
));
878 GetWindowTextLengthA(HWND hWnd
)
881 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
886 if(ProcessId
== GetCurrentProcessId())
888 return(SendMessageA(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
891 /* do not send WM_GETTEXT messages to other processes */
892 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
900 GetWindowTextLengthW(HWND hWnd
)
903 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
908 if(ProcessId
== GetCurrentProcessId())
910 return(SendMessageW(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
913 /* do not send WM_GETTEXT messages to other processes */
914 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
928 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
933 if(ProcessId
== GetCurrentProcessId())
935 return(SendMessageW(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
));
938 /* do not send WM_GETTEXT messages to other processes */
941 *((PWSTR
)lpString
) = L
'\0';
944 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, (PWSTR
)lpString
, nMaxCount
);
948 GetWindowThreadProcessId(HWND hWnd
,
949 LPDWORD lpdwProcessId
)
951 return NtUserGetWindowThreadProcessId(hWnd
, lpdwProcessId
);
959 IsChild(HWND hWndParent
,
962 if (! IsWindow(hWndParent
) || ! IsWindow(hWnd
))
969 hWnd
= (HWND
)NtUserGetWindowLong(hWnd
, GWL_HWNDPARENT
, FALSE
);
971 while (hWnd
!= NULL
&& hWnd
!= hWndParent
);
973 return hWnd
== hWndParent
;
983 return (NtUserGetWindowLong( hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
) != 0;
993 DWORD WndProc
= NtUserGetWindowLong(hWnd
, GWL_WNDPROC
, FALSE
);
994 return (0 != WndProc
|| ERROR_INVALID_WINDOW_HANDLE
!= GetLastError());
1002 IsWindowUnicode(HWND hWnd
)
1004 return NtUserIsWindowUnicode(hWnd
);
1012 IsWindowVisible(HWND hWnd
)
1014 while (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_CHILD
)
1016 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
))
1020 hWnd
= GetAncestor(hWnd
, GA_PARENT
);
1022 return(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
);
1034 // AG: I don't know if child windows are affected if the parent is
1035 // disabled. I think they stop processing messages but stay appearing
1038 return (! (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_DISABLED
));
1048 return NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MAXIMIZE
;
1056 LockSetForegroundWindow(UINT uLockCode
)
1067 MoveWindow(HWND hWnd
,
1074 return NtUserMoveWindow(hWnd
, X
, Y
, nWidth
, nHeight
, bRepaint
);
1082 AnimateWindow(HWND hwnd
,
1086 /* FIXME Add animation code */
1088 /* If trying to show/hide and it's already *
1089 * shown/hidden or invalid window, fail with *
1090 * invalid parameter */
1093 visible
= IsWindowVisible(hwnd
);
1094 // if(!IsWindow(hwnd) ||
1095 // (visible && !(dwFlags & AW_HIDE)) ||
1096 // (!visible && (dwFlags & AW_HIDE)))
1098 SetLastError(ERROR_INVALID_PARAMETER
);
1102 // ShowWindow(hwnd, (dwFlags & AW_HIDE) ? SW_HIDE : ((dwFlags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA));
1114 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
))
1119 ShowWindow(hWnd
,SW_RESTORE
);
1128 RealChildWindowFromPoint(HWND hwndParent
,
1129 POINT ptParentClientCoords
)
1139 SetForegroundWindow(HWND hWnd
)
1141 return NtUserCallHwndLock(hWnd
, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW
);
1149 SetLayeredWindowAttributes(HWND hwnd
,
1163 SetParent(HWND hWndChild
,
1166 return NtUserSetParent(hWndChild
, hWndNewParent
);
1174 SetProcessDefaultLayout(DWORD dwDefaultLayout
)
1185 SetWindowPlacement(HWND hWnd
,
1186 CONST WINDOWPLACEMENT
*lpwndpl
)
1188 return (BOOL
)NtUserSetWindowPlacement(hWnd
, (WINDOWPLACEMENT
*)lpwndpl
);
1196 SetWindowPos(HWND hWnd
,
1197 HWND hWndInsertAfter
,
1204 return NtUserSetWindowPos(hWnd
,hWndInsertAfter
, X
, Y
, cx
, cy
, uFlags
);
1212 SetWindowTextA(HWND hWnd
,
1216 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1221 if(ProcessId
!= GetCurrentProcessId())
1223 /* do not send WM_GETTEXT messages to other processes */
1224 ANSI_STRING AnsiString
;
1225 UNICODE_STRING UnicodeString
;
1229 RtlInitAnsiString(&AnsiString
, (LPSTR
)lpString
);
1230 RtlAnsiStringToUnicodeString(&UnicodeString
, &AnsiString
, TRUE
);
1231 NtUserDefSetText(hWnd
, &UnicodeString
);
1232 RtlFreeUnicodeString(&UnicodeString
);
1235 NtUserDefSetText(hWnd
, NULL
);
1237 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1239 DefWndNCPaint(hWnd
, (HRGN
)1);
1244 return SendMessageA(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1252 SetWindowTextW(HWND hWnd
,
1256 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1261 if(ProcessId
!= GetCurrentProcessId())
1263 /* do not send WM_GETTEXT messages to other processes */
1264 UNICODE_STRING UnicodeString
;
1267 RtlInitUnicodeString(&UnicodeString
, (LPWSTR
)lpString
);
1269 NtUserDefSetText(hWnd
, (lpString
? &UnicodeString
: NULL
));
1271 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1273 DefWndNCPaint(hWnd
, (HRGN
)1);
1278 return SendMessageW(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1286 ShowOwnedPopups(HWND hWnd
,
1298 ShowWindow(HWND hWnd
,
1301 return NtUserShowWindow(hWnd
, nCmdShow
);
1309 ShowWindowAsync(HWND hWnd
,
1322 TileWindows(HWND hwndParent,
1338 UpdateLayeredWindow(HWND hwnd
,
1345 BLENDFUNCTION
*pblend
,
1357 WindowFromPoint(POINT Point
)
1359 //TODO: Determine what the actual parameters to
1360 // NtUserWindowFromPoint are.
1361 return NtUserWindowFromPoint(Point
.x
, Point
.y
);
1369 MapWindowPoints(HWND hWndFrom
, HWND hWndTo
, LPPOINT lpPoints
, UINT cPoints
)
1371 POINT FromOffset
, ToOffset
;
1375 if (hWndFrom
== NULL
)
1377 FromOffset
.x
= FromOffset
.y
= 0;
1379 if(!NtUserGetClientOrigin(hWndFrom
, &FromOffset
))
1386 ToOffset
.x
= ToOffset
.y
= 0;
1388 if(!NtUserGetClientOrigin(hWndTo
, &ToOffset
))
1392 XMove
= FromOffset
.x
- ToOffset
.x
;
1393 YMove
= FromOffset
.y
- ToOffset
.y
;
1395 for (i
= 0; i
< cPoints
; i
++)
1397 lpPoints
[i
].x
+= XMove
;
1398 lpPoints
[i
].y
+= YMove
;
1400 return(MAKELONG(LOWORD(XMove
), LOWORD(YMove
)));
1408 ScreenToClient(HWND hWnd
, LPPOINT lpPoint
)
1410 return(MapWindowPoints(NULL
, hWnd
, lpPoint
, 1) != 0);
1418 ClientToScreen(HWND hWnd
, LPPOINT lpPoint
)
1420 return (MapWindowPoints( hWnd
, NULL
, lpPoint
, 1 ) != 0);
1429 SetWindowContextHelpId(HWND hwnd
,
1430 DWORD dwContextHelpId
)
1432 return NtUserSetWindowContextHelpId(hwnd
, dwContextHelpId
);
1441 GetWindowContextHelpId(HWND hwnd
)
1443 return NtUserGetWindowContextHelpId(hwnd
);
1451 InternalGetWindowText(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
1453 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
1461 IsHungAppWindow(HWND hwnd
)
1463 return (NtUserQueryWindow(hwnd
, QUERY_WINDOW_ISHUNG
) != 0);
1471 SetLastErrorEx(DWORD dwErrCode
, DWORD dwType
)
1473 SetLastError(dwErrCode
);
1483 return (HWND
)NtUserGetThreadState(0);
1491 SetTaskmanWindow(HWND x
)
1502 SetProgmanWindow(HWND x
)
1513 GetProgmanWindow(VOID
)
1524 GetTaskmanWindow(VOID
)
1534 ScrollWindow(HWND hWnd
, int dx
, int dy
, CONST RECT
*lpRect
,
1535 CONST RECT
*prcClip
)
1537 return NtUserScrollWindowEx(hWnd
, dx
, dy
, lpRect
, prcClip
, 0, NULL
,
1538 (lpRect
? 0 : SW_SCROLLCHILDREN
) | SW_INVALIDATE
) != ERROR
;
1546 ScrollWindowEx(HWND hWnd
, int dx
, int dy
, CONST RECT
*prcScroll
,
1547 CONST RECT
*prcClip
, HRGN hrgnUpdate
, LPRECT prcUpdate
, UINT flags
)
1549 return NtUserScrollWindowEx(hWnd
, dx
, dy
, prcScroll
, prcClip
, hrgnUpdate
,
1560 return NtUserAnyPopup();
1568 IsWindowInDestroy(HWND hWnd
)
1570 return NtUserIsWindowInDestroy(hWnd
);
1578 DisableProcessWindowsGhosting(VOID
)
1580 NtUserEnableProcessWindowGhosting(FALSE
);