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();
392 DWORD i
, dwCount
= 0;
398 SetLastError ( ERROR_INVALID_PARAMETER
);
402 /* FIXME instead of always making two calls, should we use some
403 sort of persistent buffer and only grow it ( requiring a 2nd
404 call ) when the buffer wasn't already big enough? */
405 /* first get how many window entries there are */
407 dwCount
= NtUserBuildHwndList (
408 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, NULL
, 0 );
409 if ( !dwCount
|| GetLastError() )
412 /* allocate buffer to receive HWND handles */
413 hHeap
= GetProcessHeap();
414 pHwnd
= HeapAlloc ( hHeap
, 0, sizeof(HWND
)*(dwCount
+1) );
417 SetLastError ( ERROR_NOT_ENOUGH_MEMORY
);
421 /* now call kernel again to fill the buffer this time */
422 dwCount
= NtUserBuildHwndList (
423 hDesktop
, hWndparent
, bChildren
, dwThreadId
, lParam
, pHwnd
, dwCount
);
424 if ( !dwCount
|| GetLastError() )
427 HeapFree ( hHeap
, 0, pHwnd
);
431 /* call the user's callback function until we're done or
432 they tell us to quit */
433 for ( i
= 0; i
< dwCount
; i
++ )
435 /* FIXME I'm only getting NULLs from Thread Enumeration, and it's
436 * probably because I'm not doing it right in NtUserBuildHwndList.
437 * Once that's fixed, we shouldn't have to check for a NULL HWND
440 if ( !(ULONG
)pHwnd
[i
] ) /* don't enumerate a NULL HWND */
442 if ( !(*lpfn
)( pHwnd
[i
], lParam
) )
444 HeapFree ( hHeap
, 0, pHwnd
);
449 HeapFree ( hHeap
, 0, pHwnd
);
461 WNDENUMPROC lpEnumFunc
,
465 hWndParent
= GetDesktopWindow();
466 return User32EnumWindows ( NULL
, hWndParent
, lpEnumFunc
, lParam
, 0, FALSE
);
475 EnumThreadWindows(DWORD dwThreadId
,
480 dwThreadId
= GetCurrentThreadId();
481 return User32EnumWindows ( NULL
, NULL
, lpfn
, lParam
, dwThreadId
, FALSE
);
489 EnumWindows(WNDENUMPROC lpEnumFunc
,
492 return User32EnumWindows ( NULL
, NULL
, lpEnumFunc
, lParam
, 0, FALSE
);
506 return User32EnumWindows ( hDesktop
, NULL
, lpfn
, lParam
, 0, FALSE
);
514 FindWindowExA(HWND hwndParent
,
519 UNICODE_STRING ucClassName
;
520 UNICODE_STRING ucWindowName
;
523 if (lpszClass
== NULL
)
525 ucClassName
.Buffer
= NULL
;
526 ucClassName
.Length
= 0;
528 else if (IS_ATOM(lpszClass
))
530 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
531 ucClassName
.Length
= 0;
535 RtlCreateUnicodeStringFromAsciiz(&ucClassName
, (LPSTR
)lpszClass
);
538 RtlCreateUnicodeStringFromAsciiz(&ucWindowName
, (LPSTR
)lpszWindow
);
540 Result
= NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
,
543 if (!IS_ATOM(lpszClass
))
544 RtlFreeUnicodeString(&ucClassName
);
545 RtlFreeUnicodeString(&ucWindowName
);
555 FindWindowExW(HWND hwndParent
,
560 UNICODE_STRING ucClassName
;
561 UNICODE_STRING ucWindowName
;
563 if (lpszClass
== NULL
)
565 ucClassName
.Buffer
= NULL
;
566 ucClassName
.Length
= 0;
568 else if (IS_ATOM(lpszClass
))
570 RtlInitUnicodeString(&ucClassName
, NULL
);
571 ucClassName
.Buffer
= (LPWSTR
)lpszClass
;
575 RtlInitUnicodeString(&ucClassName
, lpszClass
);
578 RtlInitUnicodeString(&ucWindowName
, lpszWindow
);
580 return NtUserFindWindowEx(hwndParent
, hwndChildAfter
, &ucClassName
, &ucWindowName
);
588 FindWindowA(LPCSTR lpClassName
, LPCSTR lpWindowName
)
590 //FIXME: FindWindow does not search children, but FindWindowEx does.
591 // what should we do about this?
592 return FindWindowExA (NULL
, NULL
, lpClassName
, lpWindowName
);
600 FindWindowW(LPCWSTR lpClassName
, LPCWSTR lpWindowName
)
604 There was a FIXME here earlier, but I think it is just a documentation unclarity.
606 FindWindow only searches top level windows. What they mean is that child
607 windows of other windows than the desktop can be searched.
608 FindWindowExW never does a recursive search.
613 return FindWindowExW (NULL
, NULL
, lpClassName
, lpWindowName
);
622 GetAltTabInfoA(HWND hwnd
,
637 GetAltTabInfoW(HWND hwnd
,
652 GetAncestor(HWND hwnd
, UINT gaFlags
)
654 return(NtUserGetAncestor(hwnd
, gaFlags
));
662 GetClientRect(HWND hWnd
, LPRECT lpRect
)
664 return(NtUserGetClientRect(hWnd
, lpRect
));
672 GetGUIThreadInfo(DWORD idThread
,
673 LPGUITHREADINFO lpgui
)
675 return (BOOL
)NtUserGetGUIThreadInfo(idThread
, lpgui
);
683 GetLastActivePopup(HWND hWnd
)
685 return NtUserGetLastActivePopup(hWnd
);
695 return NtUserGetParent(hWnd
);
703 GetProcessDefaultLayout(DWORD
*pdwDefaultLayout
)
714 GetTitleBarInfo(HWND hwnd
,
729 return NtUserGetWindow(hWnd
, uCmd
);
737 GetTopWindow(HWND hWnd
)
739 if (!hWnd
) hWnd
= GetDesktopWindow();
740 return GetWindow( hWnd
, GW_CHILD
);
748 GetWindowInfo(HWND hwnd
,
751 return NtUserGetWindowInfo(hwnd
, pwi
);
759 GetWindowModuleFileNameA(HWND hwnd
,
765 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
770 return GetModuleFileNameA(hWndInst
, lpszFileName
, cchFileNameMax
);
778 GetWindowModuleFileNameW(HWND hwnd
,
784 if(!(hWndInst
= NtUserGetWindowInstance(hwnd
)))
789 return GetModuleFileNameW(hWndInst
, lpszFileName
, cchFileNameMax
);
797 GetWindowPlacement(HWND hWnd
,
798 WINDOWPLACEMENT
*lpwndpl
)
800 return (BOOL
)NtUserGetWindowPlacement(hWnd
, lpwndpl
);
808 GetWindowRect(HWND hWnd
,
811 return(NtUserGetWindowRect(hWnd
, lpRect
));
819 GetWindowTextA(HWND hWnd
, LPSTR lpString
, int nMaxCount
)
823 if (lpString
== NULL
)
826 if (!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
829 if (ProcessId
!= GetCurrentProcessId())
831 /* do not send WM_GETTEXT messages to other processes */
835 Buffer
= HeapAlloc(GetProcessHeap(), 0, nMaxCount
* sizeof(WCHAR
));
838 Length
= NtUserInternalGetWindowText(hWnd
, Buffer
, nMaxCount
);
839 if (Length
> 0 && nMaxCount
> 0 &&
840 !WideCharToMultiByte(CP_ACP
, 0, Buffer
, -1,
841 lpString
, nMaxCount
, NULL
, NULL
))
845 HeapFree(GetProcessHeap(), 0, Buffer
);
847 return (LRESULT
)Length
;
850 return SendMessageA(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
);
858 GetWindowTextLengthA(HWND hWnd
)
861 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
866 if(ProcessId
== GetCurrentProcessId())
868 return(SendMessageA(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
871 /* do not send WM_GETTEXT messages to other processes */
872 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
880 GetWindowTextLengthW(HWND hWnd
)
883 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
888 if(ProcessId
== GetCurrentProcessId())
890 return(SendMessageW(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
893 /* do not send WM_GETTEXT messages to other processes */
894 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
902 GetWindowTextW(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
906 if (lpString
== NULL
)
909 if (!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
912 if (ProcessId
== GetCurrentProcessId())
913 return SendMessageW(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
);
915 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
919 GetWindowThreadProcessId(HWND hWnd
,
920 LPDWORD lpdwProcessId
)
922 return NtUserGetWindowThreadProcessId(hWnd
, lpdwProcessId
);
930 IsChild(HWND hWndParent
,
933 if (! IsWindow(hWndParent
) || ! IsWindow(hWnd
))
940 hWnd
= (HWND
)NtUserGetWindowLong(hWnd
, GWL_HWNDPARENT
, FALSE
);
942 while (hWnd
!= NULL
&& hWnd
!= hWndParent
);
944 return hWnd
== hWndParent
;
954 return (NtUserGetWindowLong( hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
) != 0;
964 DWORD WndProc
= NtUserGetWindowLong(hWnd
, GWL_WNDPROC
, FALSE
);
965 return (0 != WndProc
|| ERROR_INVALID_WINDOW_HANDLE
!= GetLastError());
973 IsWindowUnicode(HWND hWnd
)
975 return NtUserIsWindowUnicode(hWnd
);
983 IsWindowVisible(HWND hWnd
)
985 while (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_CHILD
)
987 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
))
991 hWnd
= GetAncestor(hWnd
, GA_PARENT
);
993 return(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
);
1005 // AG: I don't know if child windows are affected if the parent is
1006 // disabled. I think they stop processing messages but stay appearing
1009 return (! (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_DISABLED
));
1019 return NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MAXIMIZE
;
1027 LockSetForegroundWindow(UINT uLockCode
)
1038 MoveWindow(HWND hWnd
,
1045 return NtUserMoveWindow(hWnd
, X
, Y
, nWidth
, nHeight
, bRepaint
);
1053 AnimateWindow(HWND hwnd
,
1057 /* FIXME Add animation code */
1059 /* If trying to show/hide and it's already *
1060 * shown/hidden or invalid window, fail with *
1061 * invalid parameter */
1064 visible
= IsWindowVisible(hwnd
);
1065 if(!IsWindow(hwnd
) ||
1066 (visible
&& !(dwFlags
& AW_HIDE
)) ||
1067 (!visible
&& (dwFlags
& AW_HIDE
)))
1069 SetLastError(ERROR_INVALID_PARAMETER
);
1073 ShowWindow(hwnd
, (dwFlags
& AW_HIDE
) ? SW_HIDE
: ((dwFlags
& AW_ACTIVATE
) ? SW_SHOW
: SW_SHOWNA
));
1085 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
))
1090 ShowWindow(hWnd
,SW_RESTORE
);
1099 RealChildWindowFromPoint(HWND hwndParent
,
1100 POINT ptParentClientCoords
)
1110 SetForegroundWindow(HWND hWnd
)
1112 return NtUserCallHwndLock(hWnd
, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW
);
1120 SetLayeredWindowAttributes(HWND hwnd
,
1134 SetParent(HWND hWndChild
,
1137 return NtUserSetParent(hWndChild
, hWndNewParent
);
1145 SetProcessDefaultLayout(DWORD dwDefaultLayout
)
1156 SetWindowPlacement(HWND hWnd
,
1157 CONST WINDOWPLACEMENT
*lpwndpl
)
1159 return (BOOL
)NtUserSetWindowPlacement(hWnd
, (WINDOWPLACEMENT
*)lpwndpl
);
1167 SetWindowPos(HWND hWnd
,
1168 HWND hWndInsertAfter
,
1175 return NtUserSetWindowPos(hWnd
,hWndInsertAfter
, X
, Y
, cx
, cy
, uFlags
);
1183 SetWindowTextA(HWND hWnd
,
1187 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1192 if(ProcessId
!= GetCurrentProcessId())
1194 /* do not send WM_GETTEXT messages to other processes */
1195 ANSI_STRING AnsiString
;
1196 UNICODE_STRING UnicodeString
;
1200 RtlInitAnsiString(&AnsiString
, (LPSTR
)lpString
);
1201 RtlAnsiStringToUnicodeString(&UnicodeString
, &AnsiString
, TRUE
);
1202 NtUserDefSetText(hWnd
, &UnicodeString
);
1203 RtlFreeUnicodeString(&UnicodeString
);
1206 NtUserDefSetText(hWnd
, NULL
);
1208 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1210 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1215 return SendMessageA(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1223 SetWindowTextW(HWND hWnd
,
1227 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1232 if(ProcessId
!= GetCurrentProcessId())
1234 /* do not send WM_GETTEXT messages to other processes */
1235 UNICODE_STRING UnicodeString
;
1238 RtlInitUnicodeString(&UnicodeString
, (LPWSTR
)lpString
);
1240 NtUserDefSetText(hWnd
, (lpString
? &UnicodeString
: NULL
));
1242 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1244 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1249 return SendMessageW(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1257 ShowOwnedPopups(HWND hWnd
,
1260 return (BOOL
)NtUserCallTwoParam((DWORD
)hWnd
, fShow
, TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS
);
1268 ShowWindow(HWND hWnd
,
1271 return NtUserShowWindow(hWnd
, nCmdShow
);
1279 ShowWindowAsync(HWND hWnd
,
1282 return NtUserShowWindowAsync(hWnd
, nCmdShow
);
1291 TileWindows(HWND hwndParent,
1307 UpdateLayeredWindow(HWND hwnd
,
1314 BLENDFUNCTION
*pblend
,
1326 WindowFromPoint(POINT Point
)
1328 //TODO: Determine what the actual parameters to
1329 // NtUserWindowFromPoint are.
1330 return NtUserWindowFromPoint(Point
.x
, Point
.y
);
1338 MapWindowPoints(HWND hWndFrom
, HWND hWndTo
, LPPOINT lpPoints
, UINT cPoints
)
1340 POINT FromOffset
, ToOffset
;
1344 if (hWndFrom
== NULL
)
1346 FromOffset
.x
= FromOffset
.y
= 0;
1348 if(!NtUserGetClientOrigin(hWndFrom
, &FromOffset
))
1355 ToOffset
.x
= ToOffset
.y
= 0;
1357 if(!NtUserGetClientOrigin(hWndTo
, &ToOffset
))
1361 XMove
= FromOffset
.x
- ToOffset
.x
;
1362 YMove
= FromOffset
.y
- ToOffset
.y
;
1364 for (i
= 0; i
< cPoints
; i
++)
1366 lpPoints
[i
].x
+= XMove
;
1367 lpPoints
[i
].y
+= YMove
;
1369 return(MAKELONG(LOWORD(XMove
), LOWORD(YMove
)));
1377 ScreenToClient(HWND hWnd
, LPPOINT lpPoint
)
1379 return(MapWindowPoints(NULL
, hWnd
, lpPoint
, 1) != 0);
1387 ClientToScreen(HWND hWnd
, LPPOINT lpPoint
)
1389 return (MapWindowPoints( hWnd
, NULL
, lpPoint
, 1 ) != 0);
1398 SetWindowContextHelpId(HWND hwnd
,
1399 DWORD dwContextHelpId
)
1401 return NtUserSetWindowContextHelpId(hwnd
, dwContextHelpId
);
1410 GetWindowContextHelpId(HWND hwnd
)
1412 return NtUserGetWindowContextHelpId(hwnd
);
1420 InternalGetWindowText(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
1422 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
1430 IsHungAppWindow(HWND hwnd
)
1432 return (NtUserQueryWindow(hwnd
, QUERY_WINDOW_ISHUNG
) != 0);
1440 SetLastErrorEx(DWORD dwErrCode
, DWORD dwType
)
1442 SetLastError(dwErrCode
);
1452 return (HWND
)NtUserGetThreadState(0);
1460 SetTaskmanWindow(HWND hWnd
)
1462 return NtUserCallHwndOpt(hWnd
, HWNDOPT_ROUTINE_SETTASKMANWINDOW
);
1470 SetProgmanWindow(HWND hWnd
)
1472 return NtUserCallHwndOpt(hWnd
, HWNDOPT_ROUTINE_SETTASKMANWINDOW
);
1480 GetProgmanWindow(VOID
)
1491 GetTaskmanWindow(VOID
)
1501 ScrollWindow(HWND hWnd
, int dx
, int dy
, CONST RECT
*lpRect
,
1502 CONST RECT
*prcClip
)
1504 return NtUserScrollWindowEx(hWnd
, dx
, dy
, lpRect
, prcClip
, 0, NULL
,
1505 (lpRect
? 0 : SW_SCROLLCHILDREN
) | SW_INVALIDATE
) != ERROR
;
1513 ScrollWindowEx(HWND hWnd
, int dx
, int dy
, CONST RECT
*prcScroll
,
1514 CONST RECT
*prcClip
, HRGN hrgnUpdate
, LPRECT prcUpdate
, UINT flags
)
1516 return NtUserScrollWindowEx(hWnd
, dx
, dy
, prcScroll
, prcClip
, hrgnUpdate
,
1527 return NtUserAnyPopup();
1535 IsWindowInDestroy(HWND hWnd
)
1537 return NtUserIsWindowInDestroy(hWnd
);
1545 DisableProcessWindowsGhosting(VOID
)
1547 NtUserEnableProcessWindowGhosting(FALSE
);