43 if (
Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
56 if (
Flags & UISF_HIDEFOCUS)
58 if (
Flags & UISF_HIDEACCEL)
63 if (
Flags & UISF_HIDEFOCUS)
65 if (
Flags & UISF_HIDEACCEL)
92 if (!pWnd)
return NULL;
149 ULONG styleOld, styleNew;
150 styleOld = pwnd->
style;
151 styleNew = (pwnd->
style | set_bits) & ~clear_bits;
152 if (styleNew == styleOld)
return styleNew;
153 pwnd->
style = styleNew;
198 if (!Temp)
return TRUE;
252 TRACE(
"IntEnableWindow SF NULL\n");
294 ERR(
"Failed to allocate memory for children array\n");
329 ERR(
"Failed to allocate memory for children array\n");
368 if (
Owner == Wnd)
break;
428 if (FoundWnd !=
NULL)
523 for (
i = 0; pWndArray[
i];
i++)
531 TRACE(
"destroyed itself while in WM_DESTROY!\n");
584 TRACE(
"Tried to call co_UserFreeWindow() twice\n");
589 Window->head.pti->cVisWindows--;
605 for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
632 if (BelongsToThreadData)
723 if (
Window->PropListItems)
726 TRACE(
"Window->PropListItems %lu\n",
Window->PropListItems);
744 Window->head.pti->pDeskInfo,
754 Window->head.pti->cWindows--;
825 return (gcpd ? gcpd : Ret);
903 pWnd->
lpfnWndProc = (chWndProc ? chWndProc : NewWndProc);
938 if (Wnd == WndInsertAfter)
940 ERR(
"IntLinkWindow -- Trying to link window 0x%p to itself!!\n", Wnd);
989 while (WndInsertAfter && WndInsertAfter->
spwndNext)
991 WndInsertAfter = WndInsertAfter->
spwndNext;
1006 PWND WndInsertBefore;
1022 WndInsertBefore = WndInsertBefore->
spwndNext;
1031 PWND WndInsertAfter;
1035 if (WndInsertAfter ==
NULL)
1042 if (Wnd == WndInsertAfter)
1043 ERR(
"IntLinkHwnd -- Trying to link window 0x%p to itself!!\n", Wnd);
1068 if (Wnd->
head.pti != WndOldOwner->
head.pti)
1071 Wnd->
head.pti == WndNewOwner->
head.pti ||
1072 WndOldOwner->
head.pti != WndNewOwner->
head.pti )
1081 if (Wnd->
head.pti != WndNewOwner->
head.pti)
1084 WndOldOwner->
head.pti != WndNewOwner->
head.pti )
1097 PWND Wnd, WndOldOwner, WndNewOwner;
1109 if (!WndNewOwner && hWndNewOwner)
1145 PWND WndOldParent, pWndExam;
1164 TRACE(
"IntSetParent try to set a child as a parent.\n");
1169 pWndExam = WndNewParent;
1173 if (Wnd == pWndExam)
1175 TRACE(
"IntSetParent Failed Test for set parent to parent!\n");
1191 ERR(
"IntSetParent Window must belong to current process!\n");
1197 if ( WndOldParent &&
1208 if (WndNewParent != WndOldParent)
1221 ERR(
"SetParent Top Most from Pop up!\n");
1244 if (WndOldParent && (Wnd->
head.pti != WndOldParent->
head.pti))
1252 if (Wnd->
head.pti != WndNewParent->
head.pti)
1272 pt.x,
pt.y, 0, 0, swFlags);
1276 return WndOldParent;
1295 ERR(
"UserSetParent Access Denied!\n");
1304 ERR(
"UserSetParent Bad New Parent!\n");
1318 ERR(
"UserSetParent Bad Child!\n");
1332 hWndOldParent = WndOldParent->head.h;
1336 return( hWndOldParent);
1364 #define GROW_COUNT 8 1373 pwlNew->phwndLast = (
HWND *)((
LPBYTE)pwlNew + ibOld);
1374 pwlNew->phwndEnd = (
HWND *)((
LPBYTE)pwlNew + ibNew);
1422 #define INITIAL_COUNT 32 1429 #undef INITIAL_COUNT 1462 if (*ppwl != pwlTarget)
1511 ULONG* pcHwndNeeded)
1516 if (pcHwndNeeded ==
NULL)
1563 if (dwCount++ < cHwnd && phwndList)
1568 *phwndList =
Window->head.h;
1581 if (
Window->spwndChild && bChildren)
1617 ERR(
"Thread Id is not valid!\n");
1624 TRACE(
"Tried to enumerate windows of a non gui thread\n");
1641 if (dwCount < cHwnd && phwndList)
1646 *phwndList =
Window->head.h;
1656 ERR(
"Failure to build window list!\n");
1669 *pcHwndNeeded = dwCount;
1699 #define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == (SHORT)0x8000) 1710 if(pMonitor ==
NULL)
1764 TRACE(
"Strange use of CW_USEDEFAULT in nHeight\n");
1800 BOOL bUnicodeWindow;
1846 pdeskCreated ? pdeskCreated : pti->
rpdesk,
1857 TRACE(
"Created window object with handle %p\n",
hWnd);
1859 if (pdeskCreated && pdeskCreated->DesktopWindow ==
NULL )
1862 TRACE(
"CreateWindow setting desktop.\n");
1863 pdeskCreated->DesktopWindow =
hWnd;
1864 pdeskCreated->pDeskInfo->spwnd = pWnd;
1907 pWnd->
head.pti->cWindows++;
1992 if ( !bUnicodeWindow &&
2024 ERR(
"Warning: Unable to create CallProc for edit control. Control may not operate correctly! hwnd %p\n",
hWnd);
2120 if (hMenu)
IntSetMenu(pWnd, hMenu, &MenuChanged);
2127 if ( ParentWindow &&
2128 ParentWindow != ParentWindow->
head.
rpdesk->spwndMessage &&
2129 ParentWindow != ParentWindow->
head.
rpdesk->pDeskInfo->spwnd )
2168 ERR(
"IntCreateWindow Allocation Error.\n");
2192 POINT MaxSize, MaxPos, MinTrack, MaxTrack;
2206 ERR(
"Thread is not attached to a desktop! Cannot create window!\n");
2209 WinSta = pti->
rpdesk->rpwinstaParent;
2220 ERR(
"Failed to find class %wZ\n", ClassName);
2241 ERR(
"Cannot create a child window without a parent!\n");
2261 ERR(
"Got invalid parent window handle\n");
2264 else if (hWndOwner && !OwnerWindow)
2266 ERR(
"Got invalid owner window handle\n");
2267 ParentWindow =
NULL;
2276 ERR(
"an owned window must be created as top-level\n");
2283 OwnerWindow = OwnerWindow->spwndParent;
2305 ERR(
"IntCreateWindow failed!\n");
2326 if (!pCsw || !pCbtCreate)
2328 ERR(
"UserHeapAlloc() failed!\n");
2334 ERR(
"IntMsgCreateStructW() failed!\n");
2338 pCbtCreate->
lpcs = pCsw;
2345 ERR(
"WH_CBT HCBT_CREATEWND hook failed! 0x%x\n",
Result);
2353 hwndInsertAfter = pCbtCreate->hwndInsertAfter;
2360 Cs->
x += ParentWindow->rcClient.left;
2361 Cs->
y += ParentWindow->rcClient.top;
2372 if (
Size.cx > MaxTrack.
x)
Size.cx = MaxTrack.
x;
2373 if (
Size.cy > MaxTrack.
y)
Size.cy = MaxTrack.
y;
2374 if (
Size.cx < MinTrack.
x)
Size.cx = MinTrack.
x;
2375 if (
Size.cy < MinTrack.
y)
Size.cy = MinTrack.
y;
2378 Window->rcWindow.left = Cs->
x;
2392 if (ParentWindow !=
NULL)
2397 Window->rcWindow.right = ParentWindow->rcClient.right - (
Window->rcWindow.left - ParentWindow->rcClient.left);
2406 ERR(
"Window 0x%p has been linked too early!\n",
Window);
2419 if (pti != ParentWindow->head.pti)
2431 ERR(
"co_UserCreateWindowEx(): NCCREATE message failed\n");
2436 if (ParentWindow !=
NULL)
2448 MaxPos.
x =
Window->rcWindow.left;
2449 MaxPos.
y =
Window->rcWindow.top;
2457 MaxPos.
y -
Window->rcWindow.top);
2464 ERR(
"co_UserCreateWindowEx(): WM_CREATE message failed\n");
2551 TRACE(
"co_UserCreateWindowEx(): Created window %p\n",
hWnd);
2557 TRACE(
"co_UserCreateWindowEx(): Error Created window!\n");
2596 lstrTemp = *plstrUnsafe;
2605 if (lstrTemp.
Length != 0)
2630 plstrSafe->Buffer = pvBuffer;
2631 plstrSafe->Length = lstrTemp.
Length;
2632 plstrSafe->MaximumLength = lstrTemp.
Length;
2678 ERR(
"NtUserCreateWindowEx: Got an invalid menu handle!\n");
2688 ERR(
"NtUserCreateWindowEx: failed to capture plstrWindowName\n");
2693 plstrWindowName = &lstrWindowName;
2700 ustrClassName.
Length = 0;
2709 ERR(
"NtUserCreateWindowEx: failed to capture plstrClassName\n");
2726 ustrClsVersion.
Length = 0;
2735 ERR(
"NtUserCreateWindowEx: failed to capture plstrClsVersion\n");
2769 ERR(
"co_UserCreateWindowEx failed!\n");
2776 if (lstrWindowName.
Buffer)
2780 if (lstrClassName.
Buffer)
2784 if (lstrClsVersion.
Buffer)
2805 for (phWnd =
List; *phWnd; ++phWnd)
2828 ERR(
"IntWndBelongsToThread(0x%p) is FALSE, ignoring.\n", pWnd);
2849 TRACE(
"co_UserDestroyWindow(Window = 0x%p, hWnd = 0x%p)\n",
Window,
hWnd);
2852 if (
Window->head.pti != ti)
2867 ERR(
"Destroy Window WH_CBT Call Hook return!\n");
2910 if ((pwndTemp =
Window->spwndOwner))
2931 if (
Window->head.pti->MessageQueue->spwndActive ==
Window)
2932 Window->head.pti->MessageQueue->spwndActive =
NULL;
2933 if (
Window->head.pti->MessageQueue->spwndFocus ==
Window)
2934 Window->head.pti->MessageQueue->spwndFocus =
NULL;
2935 if (
Window->head.pti->MessageQueue->spwndActivePrev ==
Window)
2936 Window->head.pti->MessageQueue->spwndActivePrev =
NULL;
2937 if (
Window->head.pti->MessageQueue->spwndCapture ==
Window)
2938 Window->head.pti->MessageQueue->spwndCapture =
NULL;
2948 ERR(
"Destroying the ShellWindow!\n");
3017 TRACE(
"Enter NtUserDestroyWindow\n");
3032 TRACE(
"Leave NtUserDestroyWindow, ret=%u\n", _ret_);
3044 BOOL CheckWindowName;
3051 CheckWindowName = WindowName->
Buffer != 0;
3059 while(*phWnd && (*(phWnd++) != ChildAfter->
head.h))
3075 if (!ClassAtom ||
Child->pcls->atomNVClassName == ClassAtom)
3081 if(!CheckWindowName ||
3082 (
Child->strName.Length < 0xFFFF &&
3085 Ret =
Child->head.h;
3122 HWND hwndChildAfter,
3134 TRACE(
"Enter NtUserFindWindowEx\n");
3137 if (ucClassName !=
NULL || ucWindowName !=
NULL)
3141 if (ucClassName !=
NULL)
3144 if (ClassName.
Length != 0)
3156 if (!IntGetAtomFromStringOrAtom(&ClassName,
3164 if (ucWindowName !=
NULL)
3167 if (WindowName.Length != 0)
3182 if (ucClassName !=
NULL)
3203 DoMessageWnd =
TRUE;
3226 PWND TopLevelWindow;
3241 while(*phWnd && (*(phWnd++) != ChildAfter->
head.h))
3245 CheckWindowName = WindowName.Buffer != 0;
3263 WindowMatches = !CheckWindowName ||
3266 ClassMatches = (ClassAtom == (
RTL_ATOM)0) ||
3269 if (WindowMatches && ClassMatches)
3271 Ret = TopLevelWindow->
head.h;
3279 Ret = TopLevelWindow->
head.h;
3289 TRACE(
"FindWindowEx: Not Desktop Parent!\n");
3293 if (Ret ==
NULL && DoMessageWnd)
3299 Ret =
IntFindWindow(MsgWindows, ChildAfter, ClassAtom, &WindowName);
3313 TRACE(
"Leave NtUserFindWindowEx, ret %p\n", _ret_);
3396 TRACE(
"Enter NtUserGetAncestor\n");
3410 TRACE(
"Leave NtUserGetAncestor, ret=%p\n", _ret_);
3432 INT fixedOwnerDrawHeight;
3445 #define CBF_BUTTONDOWN 0x0002 3461 TRACE(
"Enter NtUserGetComboBoxInfo\n");
3492 NotSameppi = ppi != Wnd->
head.pti->ppi;
3523 TRACE(
"Leave NtUserGetComboBoxInfo, ret=%i\n",_ret_);
3570 TRACE(
"Enter NtUserGetListBoxInfo\n");
3585 NotSameppi = ppi != Wnd->
head.pti->ppi;
3595 Ret =
descr->page_size;
3608 TRACE(
"Leave NtUserGetListBoxInfo, ret=%lu\n", _ret_);
3635 TRACE(
"Enter NtUserSetParent\n");
3653 TRACE(
"Leave NtUserSetParent, ret=%p\n", _ret_);
3702 PWND WndShell, WndListView;
3708 TRACE(
"Enter NtUserSetShellWindowEx\n");
3778 ti->
pDeskInfo->hShellWindow = hwndShell;
3780 ti->
pDeskInfo->spwndBkGnd = WndListView;
3792 TRACE(
"Leave NtUserSetShellWindowEx, ret=%i\n",_ret_);
3861 ERR(
"NtUserSetWindowLong(): Index requires pointer size: %lu\n",
Index);
3872 Style.styleOld = OldValue;
3873 Style.styleNew = NewValue;
3880 WindowStation =
Window->head.pti->rpdesk->rpwinstaParent;
3904 Style.styleOld = OldValue;
3905 Style.styleNew = NewValue;
3925 ERR(
"IDMenu going null! %d\n",
Window->IDMenu);
3937 ERR(
"IDMenu released 0x%p\n",pMenu);
3989 OldValue =
Window->dwUserData;
3990 Window->dwUserData = NewValue;
3994 ERR(
"NtUserSetWindowLong(): Unsupported index %lu\n",
Index);
4109 TRACE(
"Enter NtUserSetWindowWord\n");
4149 TRACE(
"Leave NtUserSetWindowWord, ret=%u\n", _ret_);
4175 #define GWLP_CONSOLE_LEADER_PID 0 4176 #define GWLP_CONSOLE_LEADER_TID 4 4179 PWND pWnd, pwndActive;
4183 TRACE(
"Enter NtUserQueryWindow\n");
4244 if (pWnd->
head.pti->spwndDefaultIme)
4251 if (pWnd->
head.pti->spDefaultImc)
4265 ptiActive = pwndActive->
head.pti;
4280 TRACE(
"Leave NtUserQueryWindow, ret=%u\n", _ret_);
4296 TRACE(
"Enter NtUserRegisterWindowMessage\n");
4299 if(MessageNameUnsafe ==
NULL)
4313 if (SafeMessageName.
Buffer)
4318 TRACE(
"Leave NtUserRegisterWindowMessage, ret=%u\n", _ret_);
4333 TRACE(
"Enter NtUserSetWindowFNID\n");
4351 if (fnID < FNID_FIRST || fnID >
FNID_GHOST ||
4363 TRACE(
"Leave NtUserSetWindowFNID\n");
4457 TRACE(
"Enter NtUserDefSetText\n");
4459 if (WindowText !=
NULL)
4463 SafeText = ProbeForReadLargeString(WindowText);
4506 if (!Ret)
goto Exit;
4571 TRACE(
"Leave NtUserDefSetText, ret=%i\n", Ret);
4591 TRACE(
"Enter NtUserInternalGetWindowText\n");
4608 const WCHAR Terminator =
L'\0';
4637 TRACE(
"Leave NtUserInternalGetWindowText, ret=%i\n",_ret_);
4655 TRACE(
"Enter ShowOwnedPopups Show: %s\n", (fShow ?
"TRUE" :
"FALSE"));
4663 while (win_array[
count])
4665 while (--
count >= 0)
4700 TRACE(
"Leave ShowOwnedPopups\n");
#define RDW_NOINTERNALPAINT
BOOL APIENTRY NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
HWND NTAPI NtUserCreateWindowEx(DWORD dwExStyle, PLARGE_STRING plstrClassName, PLARGE_STRING plstrClsVersion, PLARGE_STRING plstrWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam, DWORD dwFlags, PVOID acbiBuffer)
PUSER_MESSAGE_QUEUE gpqForeground
#define ERROR_INVALID_PARAMETER
static const WCHAR Class[]
unsigned __int3264 UINT_PTR
HWND APIENTRY NtUserGetAncestor(HWND hWnd, UINT Type)
#define IS_WND_CHILD(pWnd)
VOID FASTCALL UserEnterShared(VOID)
GLint GLint GLsizei width
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
#define HOOKID_TO_FLAG(HookId)
LONG APIENTRY NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
#define QUERY_WINDOW_UNIQUE_THREAD_ID
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
ENGAPI ULONG APIENTRY EngGetLastError(VOID)
VOID FASTCALL co_MsqInsertMouseMessage(MSG *Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
LRESULT co_UserFreeWindow(PWND Window, PPROCESSINFO ProcessData, PTHREADINFO ThreadData, BOOLEAN SendMessages)
#define GETPFNSERVER(fnid)
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
PWND FASTCALL ValidateHwndNoErr(HWND hWnd)
#define STATUS_INSUFFICIENT_RESOURCES
HWND FASTCALL IntGetThreadFocusWindow(VOID)
LIST_ENTRY ThreadListEntry
WNDPROC pfnClientPrevious
POBJECT_TYPE ExWindowStationObjectType
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
BOOL FASTCALL MsqIsHung(PTHREADINFO pti, DWORD TimeOut)
VOID FASTCALL IntUnlinkWindow(PWND Wnd)
struct tagIMC * spDefaultImc
BOOL APIENTRY NtUserGetComboBoxInfo(HWND hWnd, PCOMBOBOXINFO pcbi)
HWND FASTCALL co_UserSetFocus(PWND Window)
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
#define UserIsDesktopWindow(pWnd)
PVOID FASTCALL UserAssignmentLock(PVOID *ppvObj, PVOID pvNew)
#define QUERY_WINDOW_FOREGROUND
BOOL FASTCALL IntReleaseCapture(VOID)
#define IntWndBelongsToThread(WndObj, W32Thread)
#define GETPFNCLIENTW(fnid)
NTSTATUS NTAPI ProbeAndCaptureLargeString(OUT PLARGE_STRING plstrSafe, IN PLARGE_STRING plstrUnsafe)
BOOL APIENTRY DefSetText(PWND Wnd, PCWSTR WindowText)
#define STATUS_INVALID_PARAMETER
#define CURSORF_FROMRESOURCE
LIST_ENTRY WindowListHead
HWND FASTCALL UserGetActiveWindow(VOID)
#define ASSERT_REFS_CO(_obj_)
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
BOOL FASTCALL IntValidateOwnerDepth(PWND Wnd, PWND Owner)
struct tagWINDOWLIST * pNextList
GLuint GLuint GLsizei count
NTSTATUS NTAPI PsLookupThreadByThreadId(IN HANDLE ThreadId, OUT PETHREAD *Thread)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define QUERY_WINDOW_REAL_ID
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
VOID FASTCALL UserClipboardRelease(PWND pWindow)
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
struct _WND::@4900 InternalPos
#define HSHELL_WINDOWCREATED