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
)
824 if (lpString
== NULL
)
827 if (!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
830 if (ProcessId
!= GetCurrentProcessId())
832 /* do not send WM_GETTEXT messages to other processes */
836 Buffer
= HeapAlloc(GetProcessHeap(), 0, nMaxCount
* sizeof(WCHAR
));
839 Length
= NtUserInternalGetWindowText(hWnd
, Buffer
, nMaxCount
);
840 if (Length
> 0 && nMaxCount
> 0 &&
841 !WideCharToMultiByte(CP_ACP
, 0, Buffer
, -1,
842 lpString
, nMaxCount
, NULL
, NULL
))
846 HeapFree(GetProcessHeap(), 0, Buffer
);
848 return (LRESULT
)Length
;
851 return SendMessageA(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
);
859 GetWindowTextLengthA(HWND hWnd
)
862 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
867 if(ProcessId
== GetCurrentProcessId())
869 return(SendMessageA(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
872 /* do not send WM_GETTEXT messages to other processes */
873 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
881 GetWindowTextLengthW(HWND hWnd
)
884 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
889 if(ProcessId
== GetCurrentProcessId())
891 return(SendMessageW(hWnd
, WM_GETTEXTLENGTH
, 0, 0));
894 /* do not send WM_GETTEXT messages to other processes */
895 return (LRESULT
)NtUserInternalGetWindowText(hWnd
, NULL
, 0);
903 GetWindowTextW(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
907 if (lpString
== NULL
)
910 if (!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
913 if (ProcessId
== GetCurrentProcessId())
914 return SendMessageW(hWnd
, WM_GETTEXT
, nMaxCount
, (LPARAM
)lpString
);
916 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
920 GetWindowThreadProcessId(HWND hWnd
,
921 LPDWORD lpdwProcessId
)
923 return NtUserGetWindowThreadProcessId(hWnd
, lpdwProcessId
);
931 IsChild(HWND hWndParent
,
934 if (! IsWindow(hWndParent
) || ! IsWindow(hWnd
))
941 hWnd
= (HWND
)NtUserGetWindowLong(hWnd
, GWL_HWNDPARENT
, FALSE
);
943 while (hWnd
!= NULL
&& hWnd
!= hWndParent
);
945 return hWnd
== hWndParent
;
955 return (NtUserGetWindowLong( hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
) != 0;
965 DWORD WndProc
= NtUserGetWindowLong(hWnd
, GWL_WNDPROC
, FALSE
);
966 return (0 != WndProc
|| ERROR_INVALID_WINDOW_HANDLE
!= GetLastError());
974 IsWindowUnicode(HWND hWnd
)
976 return NtUserIsWindowUnicode(hWnd
);
984 IsWindowVisible(HWND hWnd
)
986 while (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_CHILD
)
988 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
))
992 hWnd
= GetAncestor(hWnd
, GA_PARENT
);
994 return(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_VISIBLE
);
1006 // AG: I don't know if child windows are affected if the parent is
1007 // disabled. I think they stop processing messages but stay appearing
1010 return (! (NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_DISABLED
));
1020 return NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MAXIMIZE
;
1028 LockSetForegroundWindow(UINT uLockCode
)
1039 MoveWindow(HWND hWnd
,
1046 return NtUserMoveWindow(hWnd
, X
, Y
, nWidth
, nHeight
, bRepaint
);
1054 AnimateWindow(HWND hwnd
,
1058 /* FIXME Add animation code */
1060 /* If trying to show/hide and it's already *
1061 * shown/hidden or invalid window, fail with *
1062 * invalid parameter */
1065 visible
= IsWindowVisible(hwnd
);
1066 if(!IsWindow(hwnd
) ||
1067 (visible
&& !(dwFlags
& AW_HIDE
)) ||
1068 (!visible
&& (dwFlags
& AW_HIDE
)))
1070 SetLastError(ERROR_INVALID_PARAMETER
);
1074 ShowWindow(hwnd
, (dwFlags
& AW_HIDE
) ? SW_HIDE
: ((dwFlags
& AW_ACTIVATE
) ? SW_SHOW
: SW_SHOWNA
));
1086 if (!(NtUserGetWindowLong(hWnd
, GWL_STYLE
, FALSE
) & WS_MINIMIZE
))
1091 ShowWindow(hWnd
,SW_RESTORE
);
1100 RealChildWindowFromPoint(HWND hwndParent
,
1101 POINT ptParentClientCoords
)
1111 SetForegroundWindow(HWND hWnd
)
1113 return NtUserCallHwndLock(hWnd
, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW
);
1121 SetLayeredWindowAttributes(HWND hwnd
,
1135 SetParent(HWND hWndChild
,
1138 return NtUserSetParent(hWndChild
, hWndNewParent
);
1146 SetProcessDefaultLayout(DWORD dwDefaultLayout
)
1157 SetWindowPlacement(HWND hWnd
,
1158 CONST WINDOWPLACEMENT
*lpwndpl
)
1160 return (BOOL
)NtUserSetWindowPlacement(hWnd
, (WINDOWPLACEMENT
*)lpwndpl
);
1168 SetWindowPos(HWND hWnd
,
1169 HWND hWndInsertAfter
,
1176 return NtUserSetWindowPos(hWnd
,hWndInsertAfter
, X
, Y
, cx
, cy
, uFlags
);
1184 SetWindowTextA(HWND hWnd
,
1188 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1193 if(ProcessId
!= GetCurrentProcessId())
1195 /* do not send WM_GETTEXT messages to other processes */
1196 ANSI_STRING AnsiString
;
1197 UNICODE_STRING UnicodeString
;
1201 RtlInitAnsiString(&AnsiString
, (LPSTR
)lpString
);
1202 RtlAnsiStringToUnicodeString(&UnicodeString
, &AnsiString
, TRUE
);
1203 NtUserDefSetText(hWnd
, &UnicodeString
);
1204 RtlFreeUnicodeString(&UnicodeString
);
1207 NtUserDefSetText(hWnd
, NULL
);
1209 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1211 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1216 return SendMessageA(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1224 SetWindowTextW(HWND hWnd
,
1228 if(!NtUserGetWindowThreadProcessId(hWnd
, &ProcessId
))
1233 if(ProcessId
!= GetCurrentProcessId())
1235 /* do not send WM_GETTEXT messages to other processes */
1236 UNICODE_STRING UnicodeString
;
1239 RtlInitUnicodeString(&UnicodeString
, (LPWSTR
)lpString
);
1241 NtUserDefSetText(hWnd
, (lpString
? &UnicodeString
: NULL
));
1243 if ((GetWindowLongW(hWnd
, GWL_STYLE
) & WS_CAPTION
) == WS_CAPTION
)
1245 DefWndNCPaint(hWnd
, (HRGN
)1, -1);
1250 return SendMessageW(hWnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
1258 ShowOwnedPopups(HWND hWnd
,
1261 return (BOOL
)NtUserCallTwoParam((DWORD
)hWnd
, fShow
, TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS
);
1269 ShowWindow(HWND hWnd
,
1272 return NtUserShowWindow(hWnd
, nCmdShow
);
1280 ShowWindowAsync(HWND hWnd
,
1293 TileWindows(HWND hwndParent,
1309 UpdateLayeredWindow(HWND hwnd
,
1316 BLENDFUNCTION
*pblend
,
1328 WindowFromPoint(POINT Point
)
1330 //TODO: Determine what the actual parameters to
1331 // NtUserWindowFromPoint are.
1332 return NtUserWindowFromPoint(Point
.x
, Point
.y
);
1340 MapWindowPoints(HWND hWndFrom
, HWND hWndTo
, LPPOINT lpPoints
, UINT cPoints
)
1342 POINT FromOffset
, ToOffset
;
1346 if (hWndFrom
== NULL
)
1348 FromOffset
.x
= FromOffset
.y
= 0;
1350 if(!NtUserGetClientOrigin(hWndFrom
, &FromOffset
))
1357 ToOffset
.x
= ToOffset
.y
= 0;
1359 if(!NtUserGetClientOrigin(hWndTo
, &ToOffset
))
1363 XMove
= FromOffset
.x
- ToOffset
.x
;
1364 YMove
= FromOffset
.y
- ToOffset
.y
;
1366 for (i
= 0; i
< cPoints
; i
++)
1368 lpPoints
[i
].x
+= XMove
;
1369 lpPoints
[i
].y
+= YMove
;
1371 return(MAKELONG(LOWORD(XMove
), LOWORD(YMove
)));
1379 ScreenToClient(HWND hWnd
, LPPOINT lpPoint
)
1381 return(MapWindowPoints(NULL
, hWnd
, lpPoint
, 1) != 0);
1389 ClientToScreen(HWND hWnd
, LPPOINT lpPoint
)
1391 return (MapWindowPoints( hWnd
, NULL
, lpPoint
, 1 ) != 0);
1400 SetWindowContextHelpId(HWND hwnd
,
1401 DWORD dwContextHelpId
)
1403 return NtUserSetWindowContextHelpId(hwnd
, dwContextHelpId
);
1412 GetWindowContextHelpId(HWND hwnd
)
1414 return NtUserGetWindowContextHelpId(hwnd
);
1422 InternalGetWindowText(HWND hWnd
, LPWSTR lpString
, int nMaxCount
)
1424 return NtUserInternalGetWindowText(hWnd
, lpString
, nMaxCount
);
1432 IsHungAppWindow(HWND hwnd
)
1434 return (NtUserQueryWindow(hwnd
, QUERY_WINDOW_ISHUNG
) != 0);
1442 SetLastErrorEx(DWORD dwErrCode
, DWORD dwType
)
1444 SetLastError(dwErrCode
);
1454 return (HWND
)NtUserGetThreadState(0);
1462 SetTaskmanWindow(HWND hWnd
)
1464 return NtUserCallHwndOpt(hWnd
, HWNDOPT_ROUTINE_SETTASKMANWINDOW
);
1472 SetProgmanWindow(HWND hWnd
)
1474 return NtUserCallHwndOpt(hWnd
, HWNDOPT_ROUTINE_SETTASKMANWINDOW
);
1482 GetProgmanWindow(VOID
)
1493 GetTaskmanWindow(VOID
)
1503 ScrollWindow(HWND hWnd
, int dx
, int dy
, CONST RECT
*lpRect
,
1504 CONST RECT
*prcClip
)
1506 return NtUserScrollWindowEx(hWnd
, dx
, dy
, lpRect
, prcClip
, 0, NULL
,
1507 (lpRect
? 0 : SW_SCROLLCHILDREN
) | SW_INVALIDATE
) != ERROR
;
1515 ScrollWindowEx(HWND hWnd
, int dx
, int dy
, CONST RECT
*prcScroll
,
1516 CONST RECT
*prcClip
, HRGN hrgnUpdate
, LPRECT prcUpdate
, UINT flags
)
1518 return NtUserScrollWindowEx(hWnd
, dx
, dy
, prcScroll
, prcClip
, hrgnUpdate
,
1529 return NtUserAnyPopup();
1537 IsWindowInDestroy(HWND hWnd
)
1539 return NtUserIsWindowInDestroy(hWnd
);
1547 DisableProcessWindowsGhosting(VOID
)
1549 NtUserEnableProcessWindowGhosting(FALSE
);