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 BOOL ControlsInitialized
= FALSE
;
20 LRESULT
DefWndNCPaint(HWND hWnd
, HRGN hRgn
, BOOL Active
);
22 /* FUNCTIONS *****************************************************************/
26 User32CallSendAsyncProcForKernel(PVOID Arguments
, ULONG ArgumentLength
)
28 PSENDASYNCPROC_CALLBACK_ARGUMENTS CallbackArgs
;
30 DPRINT("User32CallSendAsyncProcKernel()\n");
31 CallbackArgs
= (PSENDASYNCPROC_CALLBACK_ARGUMENTS
)Arguments
;
32 if (ArgumentLength
!= sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
))
34 return(STATUS_INFO_LENGTH_MISMATCH
);
36 CallbackArgs
->Callback(CallbackArgs
->Wnd
, CallbackArgs
->Msg
,
37 CallbackArgs
->Context
, CallbackArgs
->Result
);
38 return(STATUS_SUCCESS
);
46 AllowSetForegroundWindow(DWORD dwProcessId
)
57 BeginDeferWindowPos(int nNumWindows
)
72 BringWindowToTop(HWND hWnd
)
74 return NtUserSetWindowPos( hWnd
,
80 SWP_NOSIZE
| SWP_NOMOVE
);
89 CascadeWindows(HWND hwndParent,
102 SwitchToThisWindow ( HWND hwnd
, BOOL fUnknown
)
104 ShowWindow ( hwnd
, SW_SHOW
);
111 ChildWindowFromPoint(HWND hWndParent
,
114 return (HWND
) NtUserChildWindowFromPointEx(hWndParent
, Point
.x
, Point
.y
, 0);
122 ChildWindowFromPointEx(HWND hwndParent
,
126 return (HWND
) NtUserChildWindowFromPointEx(hwndParent
, pt
.x
, pt
.y
, uFlags
);
134 CloseWindow(HWND hWnd
)
136 SendMessageA(hWnd
, WM_SYSCOMMAND
, SC_CLOSE
, 0);
145 CreateWindowExA(DWORD dwExStyle
,
158 UNICODE_STRING WindowName
;
159 UNICODE_STRING ClassName
;
164 DbgPrint("[window] CreateWindowExA style %d, exstyle %d, parent %d\n", dwStyle
, dwExStyle
, hWndParent
);
167 if (IS_ATOM(lpClassName
))
169 RtlInitUnicodeString(&ClassName
, NULL
);
170 ClassName
.Buffer
= (LPWSTR
)lpClassName
;
174 if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName
), (PCSZ
)lpClassName
))
176 SetLastError(ERROR_OUTOFMEMORY
);
181 /* Register built-in controls if not already done */
182 if (! ControlsInitialized
)
184 ControlsInitialized
= ControlsInit(ClassName
.Buffer
);
187 if (dwExStyle
& WS_EX_MDICHILD
)
189 if (!IS_ATOM(lpClassName
))
190 RtlFreeUnicodeString(&ClassName
);
191 return CreateMDIWindowA(lpClassName
, lpWindowName
, dwStyle
, x
, y
,
192 nWidth
, nHeight
, hWndParent
, hInstance
, (LPARAM
)lpParam
);
195 if (!RtlCreateUnicodeStringFromAsciiz(&WindowName
, (PCSZ
)lpWindowName
))
197 if (!IS_ATOM(lpClassName
))
199 RtlFreeUnicodeString(&ClassName
);
201 SetLastError(ERROR_OUTOFMEMORY
);
205 if(!hMenu
&& (dwStyle
& (WS_OVERLAPPEDWINDOW
| WS_POPUP
)))
207 wce
.cbSize
= sizeof(WNDCLASSEXA
);
208 if(GetClassInfoExA(hInstance
, lpClassName
, &wce
) && wce
.lpszMenuName
)
210 hMenu
= LoadMenuA(hInstance
, wce
.lpszMenuName
);
214 Handle
= NtUserCreateWindowEx(dwExStyle
,
230 DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle
);
233 RtlFreeUnicodeString(&WindowName
);
235 if (!IS_ATOM(lpClassName
))
237 RtlFreeUnicodeString(&ClassName
);
248 CreateWindowExW(DWORD dwExStyle
,
250 LPCWSTR lpWindowName
,
261 UNICODE_STRING WindowName
;
262 UNICODE_STRING ClassName
;
266 /* Register built-in controls if not already done */
267 if (! ControlsInitialized
)
269 ControlsInitialized
= ControlsInit(lpClassName
);
272 if (dwExStyle
& WS_EX_MDICHILD
)
273 return CreateMDIWindowW(lpClassName
, lpWindowName
, dwStyle
, x
, y
,
274 nWidth
, nHeight
, hWndParent
, hInstance
, (LPARAM
)lpParam
);
276 if (IS_ATOM(lpClassName
))
278 RtlInitUnicodeString(&ClassName
, NULL
);
279 ClassName
.Buffer
= (LPWSTR
)lpClassName
;
283 RtlInitUnicodeString(&ClassName
, lpClassName
);
286 RtlInitUnicodeString(&WindowName
, lpWindowName
);
288 if(!hMenu
&& (dwStyle
& (WS_OVERLAPPEDWINDOW
| WS_POPUP
)))
290 wce
.cbSize
= sizeof(WNDCLASSEXW
);
291 if(GetClassInfoExW(hInstance
, lpClassName
, &wce
) && wce
.lpszMenuName
)
293 hMenu
= LoadMenuW(hInstance
, wce
.lpszMenuName
);
297 Handle
= NtUserCreateWindowEx(dwExStyle
,
320 DeferWindowPos(HDWP hWinPosInfo
,
322 HWND hWndInsertAfter
,
330 return NtUserDeferWindowPos(hWinPosInfo
, hWnd
, hWndInsertAfter
, x
, y
, cx
, cy
, uFlags
);
332 SetWindowPos(hWnd
, hWndInsertAfter
, x
, y
, cx
, cy
, uFlags
);
342 DestroyWindow(HWND hWnd
)
344 return NtUserDestroyWindow(hWnd
);
352 EndDeferWindowPos(HDWP hWinPosInfo
)
367 GetDesktopWindow(VOID
)
369 return NtUserGetDesktopWindow();
377 GetForegroundWindow(VOID
)
379 return NtUserGetForegroundWindow();
393 DWORD i
, dwCount
= 0;
399 SetLastError ( ERROR_INVALID_PARAMETER
);
403 /* FIXME instead of always making two calls, should we use some
404 sort of persistent buffer and only grow it ( requiring a 2nd
405 call ) when the buffer wasn't already big enough? */
406 /* first get how many window entries there are */
408 dwCount
= NtUserBuildHwndList (
409 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, NULL
, 0 );
410 if ( !dwCount
|| GetLastError() )
413 /* allocate buffer to receive HWND handles */
414 hHeap
= GetProcessHeap();
415 pHwnd
= HeapAlloc ( hHeap
, 0, sizeof(HWND
)*(dwCount
+1) );
418 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
422 /* now call kernel again to fill the buffer this time */
423 dwCount
= NtUserBuildHwndList (
424 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, pHwnd
, dwCount
);
425 if ( !dwCount
|| GetLastError() )
428 HeapFree ( hHeap
, 0, pHwnd
);
432 /* call the user's callback function until we're done or
433 they tell us to quit */
434 for ( i
= 0; i
< dwCount
; i
++ )
436 /* FIXME I'm only getting NULLs from Thread Enumeration, and it's
437 * probably because I'm not doing it right in NtUserBuildHwndList.
438 * Once that's fixed, we shouldn't have to check for a NULL HWND
441 if ( !(ULONG
)pHwnd
[i
] ) /* don't enumerate a NULL HWND */
443 if ( !(*lpfn
)( pHwnd
[i
], lParam
) )
445 HeapFree ( hHeap
, 0, pHwnd
);
450 HeapFree ( hHeap
, 0, pHwnd
);
462 WNDENUMPROC lpEnumFunc
,
466 hWndParent
= GetDesktopWindow();
467 return User32EnumWindows ( NULL
, hWndParent
, lpEnumFunc
, lParam
, 0, FALSE
);
476 EnumThreadWindows(DWORD dwThreadId
,
481 dwThreadId
= GetCurrentThreadId();
482 return User32EnumWindows ( NULL
, NULL
, lpfn
, lParam
, dwThreadId
, FALSE
);
490 EnumWindows(WNDENUMPROC lpEnumFunc
,
493 return User32EnumWindows ( NULL
, NULL
, lpEnumFunc
, lParam
, 0, FALSE
);
507 return User32EnumWindows ( hDesktop
, NULL
, lpfn
, lParam
, 0, FALSE
);
515 FindWindowExA(HWND hwndParent
,
520 UNICODE_STRING ucClassName
;
521 UNICODE_STRING ucWindowName
;
524 if (lpszClass
== NULL
)
526 ucClassName
.Buffer
= NULL
;
527 ucClassName
.Length
= 0;
529 else if (IS_ATOM(lpszClass
))
531 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
532 ucClassName
.Length
= 0;
536 RtlCreateUnicodeStringFromAsciiz(&ucClassName
, (LPSTR
)lpszClass
);
539 RtlCreateUnicodeStringFromAsciiz(&ucWindowName
, (LPSTR
)lpszWindow
);
541 Result
= NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
,
544 if (!IS_ATOM(lpszClass
))
545 RtlFreeUnicodeString(&ucClassName
);
546 RtlFreeUnicodeString(&ucWindowName
);
556 FindWindowExW(HWND hwndParent
,
561 UNICODE_STRING ucClassName
;
562 UNICODE_STRING ucWindowName
;
564 if (lpszClass
== NULL
)
566 ucClassName
.Buffer
= NULL
;
567 ucClassName
.Length
= 0;
569 else if (IS_ATOM(lpszClass
))
571 RtlInitUnicodeString(&ucClassName
, NULL
);
572 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
576 RtlInitUnicodeString(&ucClassName
, lpszClass
);
579 RtlInitUnicodeString(&ucWindowName
, lpszWindow
);
581 return NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
, &ucWindowName
);
589 FindWindowA(LPCSTR lpClassName
, LPCSTR lpWindowName
)
591 //FIXME: FindWindow does not search children, but FindWindowEx does.
592 // what should we do about this?
593 return FindWindowExA (NULL
, NULL
, lpClassName
, lpWindowName
);
601 FindWindowW(LPCWSTR lpClassName
, LPCWSTR lpWindowName
)
605 There was a FIXME here earlier, but I think it is just a documentation unclarity.
607 FindWindow only searches top level windows. What they mean is that child
608 windows of other windows than the desktop can be searched.
609 FindWindowExW never does a recursive search.
614 return FindWindowExW (NULL
, NULL
, lpClassName
, lpWindowName
);
623 GetAltTabInfoA(HWND hwnd
,
638 GetAltTabInfoW(HWND hwnd
,
653 GetAncestor(HWND hwnd
, UINT gaFlags
)
655 return(NtUserGetAncestor(hwnd
, gaFlags
));
663 GetClientRect(HWND hWnd
, LPRECT lpRect
)
665 return(NtUserGetClientRect(hWnd
, lpRect
));
673 GetGUIThreadInfo(DWORD idThread
,
674 LPGUITHREADINFO lpgui
)
676 return (BOOL
)NtUserGetGUIThreadInfo(idThread
, lpgui
);
684 GetLastActivePopup(HWND hWnd
)
686 return NtUserGetLastActivePopup(hWnd
);
696 return NtUserGetParent(hWnd
);
704 GetProcessDefaultLayout(DWORD
*pdwDefaultLayout
)
715 GetTitleBarInfo(HWND hwnd
,
730 return NtUserGetWindow(hWnd
, uCmd
);
738 GetTopWindow(HWND hWnd
)
740 if (!hWnd
) hWnd
= GetDesktopWindow();
741 return GetWindow( hWnd
, GW_CHILD
);
749 GetWindowInfo(HWND hwnd
,
752 return NtUserGetWindowInfo(hwnd
, pwi
);
760 GetWindowModuleFileNameA(HWND hwnd
,
766 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
771 return GetModuleFileNameA(hWndInst
, lpszFileName
, cchFileNameMax
);
779 GetWindowModuleFileNameW(HWND hwnd
,
785 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
790 return GetModuleFileNameW(hWndInst
, lpszFileName
, cchFileNameMax
);
798 GetWindowPlacement(HWND hWnd
,
799 WINDOWPLACEMENT
*lpwndpl
)
801 return (BOOL
)NtUserGetWindowPlacement(hWnd
, lpwndpl
);
809 GetWindowRect(HWND hWnd
,
812 return(NtUserGetWindowRect(hWnd
, lpRect
));
820 GetWindowTextA(HWND hWnd
, LPSTR lpString
, int nMaxCount
)
823 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
828 if(ProcessId
!= GetCurrentProcessId())
830 /* do not send WM_GETTEXT messages to other processes */
836 *((PWSTR
)lpString
) = '\0';
838 Buffer
= HeapAlloc(GetProcessHeap(), 0, nMaxCount
* sizeof(WCHAR
));
841 Length
= NtUserInternalGetWindowText(hWnd
, Buffer
, nMaxCount
);
842 if (Length
> 0 && nMaxCount
> 0 &&
843 !WideCharToMultiByte(CP_ACP
, 0, Buffer
, -1,
844 lpString
, nMaxCount
, NULL
, NULL
))
849 HeapFree(GetProcessHeap(), 0, Buffer
);
851 return (LRESULT
)Length
;
854 return(SendMessageA(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
));
862 GetWindowTextLengthA(HWND hWnd
)
865 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
870 if(ProcessId
== GetCurrentProcessId())
872 return(SendMessageA(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
875 /* do not send WM_GETTEXT messages to other processes */
876 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
884 GetWindowTextLengthW(HWND hWnd
)
887 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
892 if(ProcessId
== GetCurrentProcessId())
894 return(SendMessageW(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
897 /* do not send WM_GETTEXT messages to other processes */
898 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
912 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
917 if(ProcessId
== GetCurrentProcessId())
919 return(SendMessageW(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
));
922 /* do not send WM_GETTEXT messages to other processes */
925 *((PWSTR
)lpString
) = L
'\0';
928 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, (PWSTR
)lpString
, nMaxCount
);
932 GetWindowThreadProcessId(HWND hWnd
,
933 LPDWORD lpdwProcessId
)
935 return NtUserGetWindowThreadProcessId(hWnd
, lpdwProcessId
);
943 IsChild(HWND hWndParent
,
946 if (! IsWindow(hWndParent
) || ! IsWindow(hWnd
))
953 hWnd
= (HWND
)NtUserGetWindowLong(hWnd
, GWL_HWNDPARENT
, FALSE
);
955 while (hWnd
!= NULL
&& hWnd
!= hWndParent
);
957 return hWnd
== hWndParent
;
967 return (NtUserGetWindowLong( hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
) != 0;
977 DWORD WndProc
= NtUserGetWindowLong(hWnd
, GWL_WNDPROC
, FALSE
);
978 return (0 != WndProc
|| ERROR_INVALID_WINDOW_HANDLE
!= GetLastError());
986 IsWindowUnicode(HWND hWnd
)
988 return NtUserIsWindowUnicode(hWnd
);
996 IsWindowVisible(HWND hWnd
)
998 while (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_CHILD
)
1000 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
))
1004 hWnd
= GetAncestor(hWnd
, GA_PARENT
);
1006 return(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
);
1018 // AG: I don't know if child windows are affected if the parent is
1019 // disabled. I think they stop processing messages but stay appearing
1022 return (! (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_DISABLED
));
1032 return NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MAXIMIZE
;
1040 LockSetForegroundWindow(UINT uLockCode
)
1051 MoveWindow(HWND hWnd
,
1058 return NtUserMoveWindow(hWnd
, X
, Y
, nWidth
, nHeight
, bRepaint
);
1066 AnimateWindow(HWND hwnd
,
1070 /* FIXME Add animation code */
1072 /* If trying to show/hide and it's already *
1073 * shown/hidden or invalid window, fail with *
1074 * invalid parameter */
1077 visible
= IsWindowVisible(hwnd
);
1078 if(!IsWindow(hwnd
) ||
1079 (visible
&& !(dwFlags
& AW_HIDE
)) ||
1080 (!visible
&& (dwFlags
& AW_HIDE
)))
1082 SetLastError(ERROR_INVALID_PARAMETER
);
1086 ShowWindow(hwnd
, (dwFlags
& AW_HIDE
) ? SW_HIDE
: ((dwFlags
& AW_ACTIVATE
) ? SW_SHOW
: SW_SHOWNA
));
1098 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
))
1103 ShowWindow(hWnd
,SW_RESTORE
);
1112 RealChildWindowFromPoint(HWND hwndParent
,
1113 POINT ptParentClientCoords
)
1123 SetForegroundWindow(HWND hWnd
)
1125 return NtUserCallHwndLock(hWnd
, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW
);
1133 SetLayeredWindowAttributes(HWND hwnd
,
1147 SetParent(HWND hWndChild
,
1150 return NtUserSetParent(hWndChild
, hWndNewParent
);
1158 SetProcessDefaultLayout(DWORD dwDefaultLayout
)
1169 SetWindowPlacement(HWND hWnd
,
1170 CONST WINDOWPLACEMENT
*lpwndpl
)
1172 return (BOOL
)NtUserSetWindowPlacement(hWnd
, (WINDOWPLACEMENT
*)lpwndpl
);
1180 SetWindowPos(HWND hWnd
,
1181 HWND hWndInsertAfter
,
1188 return NtUserSetWindowPos(hWnd
,hWndInsertAfter
, X
, Y
, cx
, cy
, uFlags
);
1196 SetWindowTextA(HWND hWnd
,
1200 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1205 if(ProcessId
!= GetCurrentProcessId())
1207 /* do not send WM_GETTEXT messages to other processes */
1208 ANSI_STRING AnsiString
;
1209 UNICODE_STRING UnicodeString
;
1213 RtlInitAnsiString(&AnsiString
, (LPSTR
)lpString
);
1214 RtlAnsiStringToUnicodeString(&UnicodeString
, &AnsiString
, TRUE
);
1215 NtUserDefSetText(hWnd
, &UnicodeString
);
1216 RtlFreeUnicodeString(&UnicodeString
);
1219 NtUserDefSetText(hWnd
, NULL
);
1221 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1223 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1228 return SendMessageA(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1236 SetWindowTextW(HWND hWnd
,
1240 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1245 if(ProcessId
!= GetCurrentProcessId())
1247 /* do not send WM_GETTEXT messages to other processes */
1248 UNICODE_STRING UnicodeString
;
1251 RtlInitUnicodeString(&UnicodeString
, (LPWSTR
)lpString
);
1253 NtUserDefSetText(hWnd
, (lpString
? &UnicodeString
: NULL
));
1255 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1257 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1262 return SendMessageW(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1270 ShowOwnedPopups(HWND hWnd
,
1273 return (BOOL
)NtUserCallTwoParam((DWORD
)hWnd
, fShow
, TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS
);
1281 ShowWindow(HWND hWnd
,
1284 return NtUserShowWindow(hWnd
, nCmdShow
);
1292 ShowWindowAsync(HWND hWnd
,
1305 TileWindows(HWND hwndParent,
1321 UpdateLayeredWindow(HWND hwnd
,
1328 BLENDFUNCTION
*pblend
,
1340 WindowFromPoint(POINT Point
)
1342 //TODO: Determine what the actual parameters to
1343 // NtUserWindowFromPoint are.
1344 return NtUserWindowFromPoint(Point
.x
, Point
.y
);
1352 MapWindowPoints(HWND hWndFrom
, HWND hWndTo
, LPPOINT lpPoints
, UINT cPoints
)
1354 POINT FromOffset
, ToOffset
;
1358 if (hWndFrom
== NULL
)
1360 FromOffset
.x
= FromOffset
.y
= 0;
1362 if(!NtUserGetClientOrigin(hWndFrom
, &FromOffset
))
1369 ToOffset
.x
= ToOffset
.y
= 0;
1371 if(!NtUserGetClientOrigin(hWndTo
, &ToOffset
))
1375 XMove
= FromOffset
.x
- ToOffset
.x
;
1376 YMove
= FromOffset
.y
- ToOffset
.y
;
1378 for (i
= 0; i
< cPoints
; i
++)
1380 lpPoints
[i
].x
+= XMove
;
1381 lpPoints
[i
].y
+= YMove
;
1383 return(MAKELONG(LOWORD(XMove
), LOWORD(YMove
)));
1391 ScreenToClient(HWND hWnd
, LPPOINT lpPoint
)
1393 return(MapWindowPoints(NULL
, hWnd
, lpPoint
, 1) != 0);
1401 ClientToScreen(HWND hWnd
, LPPOINT lpPoint
)
1403 return (MapWindowPoints( hWnd
, NULL
, lpPoint
, 1 ) != 0);
1412 SetWindowContextHelpId(HWND hwnd
,
1413 DWORD dwContextHelpId
)
1415 return NtUserSetWindowContextHelpId(hwnd
, dwContextHelpId
);
1424 GetWindowContextHelpId(HWND hwnd
)
1426 return NtUserGetWindowContextHelpId(hwnd
);
1434 InternalGetWindowText(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
1436 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
1444 IsHungAppWindow(HWND hwnd
)
1446 return (NtUserQueryWindow(hwnd
, QUERY_WINDOW_ISHUNG
) != 0);
1454 SetLastErrorEx(DWORD dwErrCode
, DWORD dwType
)
1456 SetLastError(dwErrCode
);
1466 return (HWND
)NtUserGetThreadState(0);
1474 SetTaskmanWindow(HWND x
)
1485 SetProgmanWindow(HWND x
)
1496 GetProgmanWindow(VOID
)
1507 GetTaskmanWindow(VOID
)
1517 ScrollWindow(HWND hWnd
, int dx
, int dy
, CONST RECT
*lpRect
,
1518 CONST RECT
*prcClip
)
1520 return NtUserScrollWindowEx(hWnd
, dx
, dy
, lpRect
, prcClip
, 0, NULL
,
1521 (lpRect
? 0 : SW_SCROLLCHILDREN
) | SW_INVALIDATE
) != ERROR
;
1529 ScrollWindowEx(HWND hWnd
, int dx
, int dy
, CONST RECT
*prcScroll
,
1530 CONST RECT
*prcClip
, HRGN hrgnUpdate
, LPRECT prcUpdate
, UINT flags
)
1532 return NtUserScrollWindowEx(hWnd
, dx
, dy
, prcScroll
, prcClip
, hrgnUpdate
,
1543 return NtUserAnyPopup();
1551 IsWindowInDestroy(HWND hWnd
)
1553 return NtUserIsWindowInDestroy(hWnd
);
1561 DisableProcessWindowsGhosting(VOID
)
1563 NtUserEnableProcessWindowGhosting(FALSE
);