45 if (
Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
58 if (
Flags & UISF_HIDEFOCUS)
60 if (
Flags & UISF_HIDEACCEL)
65 if (
Flags & UISF_HIDEFOCUS)
67 if (
Flags & UISF_HIDEACCEL)
147 ULONG styleOld, styleNew;
148 styleOld = pwnd->
style;
149 styleNew = (pwnd->
style | set_bits) & ~clear_bits;
150 if (styleNew == styleOld)
return styleNew;
151 pwnd->
style = styleNew;
196 if (!Temp)
return TRUE;
250 TRACE(
"IntEnableWindow SF NULL\n");
292 ERR(
"Failed to allocate memory for children array\n");
336 ERR(
"Failed to allocate memory for children array\n");
375 if (
Owner == Wnd)
break;
435 if (FoundWnd !=
NULL)
530 for (
i = 0; pWndArray[
i];
i++)
538 TRACE(
"destroyed itself while in WM_DESTROY!\n");
592 TRACE(
"Tried to call co_UserFreeWindow() twice\n");
596 Window->style &= ~WS_VISIBLE;
597 Window->head.pti->cVisWindows--;
613 for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
640 if (BelongsToThreadData)
703 Window->state &= ~WNDS_INTERNALPAINT;
731 if (
Window->PropListItems)
734 TRACE(
"Window->PropListItems %lu\n",
Window->PropListItems);
758 Window->head.pti->pDeskInfo,
768 Window->head.pti->cWindows--;
839 return (gcpd ? gcpd : Ret);
886 pWnd->
state &= ~WNDS_ANSIWINDOWPROC;
896 pWnd->
state &= ~WNDS_ANSIWINDOWPROC;
899 pWnd->
state &= ~WNDS_SERVERSIDEWINDOWPROC;
917 pWnd->
lpfnWndProc = (chWndProc ? chWndProc : NewWndProc);
952 if (Wnd == WndInsertAfter)
954 ERR(
"Trying to link window 0x%p to itself\n", Wnd);
955 ASSERT(WndInsertAfter != Wnd);
992 Wnd->
ExStyle &= ~WS_EX_TOPMOST;
1001 PWND WndInsertAfter;
1004 while (WndInsertAfter && WndInsertAfter->
spwndNext)
1006 WndInsertAfter = WndInsertAfter->
spwndNext;
1010 Wnd->
ExStyle &= ~WS_EX_TOPMOST;
1021 PWND WndInsertBefore;
1037 WndInsertBefore = WndInsertBefore->
spwndNext;
1046 PWND WndInsertAfter;
1050 if (WndInsertAfter ==
NULL)
1057 if (Wnd == WndInsertAfter)
1059 ERR(
"Trying to link window 0x%p to itself\n", Wnd);
1060 ASSERT(WndInsertAfter != Wnd);
1071 Wnd->
ExStyle &= ~WS_EX_TOPMOST;
1090 if (Wnd->
head.pti != WndOldOwner->
head.pti)
1093 Wnd->
head.pti == WndNewOwner->
head.pti ||
1094 WndOldOwner->
head.pti != WndNewOwner->
head.pti )
1103 if (Wnd->
head.pti != WndNewOwner->
head.pti)
1106 WndOldOwner->
head.pti != WndNewOwner->
head.pti )
1120 PWND Wnd, WndOldOwner, WndNewOwner;
1132 if (!WndNewOwner && hWndNewOwner)
1161 PWND WndOldParent, pWndExam;
1180 TRACE(
"IntSetParent try to set a child as a parent.\n");
1185 pWndExam = WndNewParent;
1189 if (Wnd == pWndExam)
1191 TRACE(
"IntSetParent Failed Test for set parent to parent!\n");
1207 ERR(
"IntSetParent Window must belong to current process!\n");
1213 if ( WndOldParent &&
1238 ERR(
"SetParent Top Most from Pop up\n");
1260 if (WndOldParent && (Wnd->
head.pti != WndOldParent->
head.pti))
1268 if (Wnd->
head.pti != WndNewParent->
head.pti)
1288 pt.x,
pt.y, 0, 0, swFlags);
1292 return WndOldParent;
1311 ERR(
"UserSetParent Access Denied!\n");
1320 ERR(
"UserSetParent Bad New Parent!\n");
1334 ERR(
"UserSetParent Bad Child!\n");
1352 return hWndOldParent;
1439#define INITIAL_COUNT 32
1479 if (*ppwl != pwlTarget)
1528 ULONG* pcHwndNeeded)
1533 if (pcHwndNeeded ==
NULL)
1580 if (dwCount++ < cHwnd && phwndList)
1598 if (
Window->spwndChild && bChildren)
1634 ERR(
"Thread Id is not valid!\n");
1641 TRACE(
"Tried to enumerate windows of a non gui thread\n");
1658 if (dwCount < cHwnd && phwndList)
1673 ERR(
"Failure to build window list!\n");
1686 *pcHwndNeeded = dwCount;
1716#define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == (SHORT)0x8000)
1727 if(pMonitor ==
NULL)
1781 TRACE(
"Strange use of CW_USEDEFAULT in nHeight\n");
1817 BOOL bUnicodeWindow;
1863 pdeskCreated ? pdeskCreated : pti->
rpdesk,
1874 TRACE(
"Created window object with handle %p\n",
hWnd);
1879 TRACE(
"CreateWindow setting desktop.\n");
1925 pWnd->
head.pti->cWindows++;
2010 if ( !bUnicodeWindow &&
2026 pWnd->
state &= ~WNDS_ANSIWINDOWPROC;
2042 ERR(
"Warning: Unable to create CallProc for edit control. Control may not operate correctly! hwnd %p\n",
hWnd);
2088 pWnd->
ExStyle &= ~WS_EX_WINDOWEDGE;
2116 if (hMenu)
IntSetMenu(pWnd, hMenu, &MenuChanged);
2123 if ( ParentWindow &&
2124 ParentWindow != ParentWindow->
head.
rpdesk->spwndMessage &&
2125 ParentWindow != ParentWindow->
head.
rpdesk->pDeskInfo->spwnd )
2164 ERR(
"IntCreateWindow Allocation Error.\n");
2188 POINT MaxSize, MaxPos, MinTrack, MaxTrack;
2202 ERR(
"Thread is not attached to a desktop! Cannot create window (%wZ)\n", ClassName);
2205 WinSta = pti->
rpdesk->rpwinstaParent;
2216 ERR(
"Failed to find class %wZ\n", ClassName);
2237 ERR(
"Cannot create a child window (%wZ) without a parent\n", ClassName);
2257 ERR(
"Got invalid parent window handle for %wZ\n", ClassName);
2260 else if (hWndOwner && !OwnerWindow)
2262 ERR(
"Got invalid owner window handle for %wZ\n", ClassName);
2263 ParentWindow =
NULL;
2272 ERR(
"an owned window must be created as top-level\n");
2279 OwnerWindow = OwnerWindow->spwndParent;
2301 ERR(
"IntCreateWindow(%wZ) failed\n", ClassName);
2322 if (!pCsw || !pCbtCreate)
2324 ERR(
"UserHeapAlloc() failed!\n");
2330 ERR(
"IntMsgCreateStructW() failed!\n");
2334 pCbtCreate->
lpcs = pCsw;
2341 ERR(
"WH_CBT HCBT_CREATEWND hook failed! 0x%x\n",
Result);
2349 hwndInsertAfter = pCbtCreate->hwndInsertAfter;
2356 Cs->
x += ParentWindow->rcClient.left;
2357 Cs->
y += ParentWindow->rcClient.top;
2368 if (
Size.cx > MaxTrack.
x)
Size.cx = MaxTrack.
x;
2369 if (
Size.cy > MaxTrack.
y)
Size.cy = MaxTrack.
y;
2370 if (
Size.cx < MinTrack.
x)
Size.cx = MinTrack.
x;
2371 if (
Size.cy < MinTrack.
y)
Size.cy = MinTrack.
y;
2374 Window->rcWindow.left = Cs->
x;
2388 if (ParentWindow !=
NULL)
2393 Window->rcWindow.right = ParentWindow->rcClient.right - (
Window->rcWindow.left - ParentWindow->rcClient.left);
2402 ERR(
"Window 0x%p has been linked too early!\n",
Window);
2415 if (pti != ParentWindow->head.pti)
2427 ERR(
"co_UserCreateWindowEx(%wZ): NCCREATE message failed\n", ClassName);
2432 if (ParentWindow !=
NULL)
2471 MaxPos.
x =
Window->rcWindow.left;
2472 MaxPos.
y =
Window->rcWindow.top;
2480 MaxPos.
y -
Window->rcWindow.top);
2487 ERR(
"co_UserCreateWindowEx(%wZ): WM_CREATE message failed\n", ClassName);
2578 TRACE(
"co_UserCreateWindowEx(%wZ): Created window %p\n", ClassName,
hWnd);
2584 TRACE(
"co_UserCreateWindowEx(): Error Created window!\n");
2623 lstrTemp = *plstrUnsafe;
2632 if (lstrTemp.
Length != 0)
2657 plstrSafe->Buffer = pvBuffer;
2658 plstrSafe->Length = lstrTemp.
Length;
2659 plstrSafe->MaximumLength = lstrTemp.
Length;
2705 ERR(
"NtUserCreateWindowEx: Got an invalid menu handle!\n");
2715 ERR(
"NtUserCreateWindowEx: failed to capture plstrWindowName\n");
2720 plstrWindowName = &lstrWindowName;
2727 ustrClassName.
Length = 0;
2736 ERR(
"NtUserCreateWindowEx: failed to capture plstrClassName\n");
2753 ustrClsVersion.
Length = 0;
2762 ERR(
"NtUserCreateWindowEx: failed to capture plstrClsVersion\n");
2796 ERR(
"co_UserCreateWindowEx failed!\n");
2803 if (lstrWindowName.
Buffer)
2807 if (lstrClassName.
Buffer)
2811 if (lstrClsVersion.
Buffer)
2831 for (phWnd =
List; *phWnd; ++phWnd)
2848 ERR(
"IntWndBelongsToThread(0x%p) is FALSE, ignoring.\n", pWnd);
2871 TRACE(
"Tried to destroy a window twice\n");
2878 TRACE(
"co_UserDestroyWindow(Window = 0x%p, hWnd = 0x%p)\n",
Window,
hWnd);
2881 if (
Window->head.pti != ti)
2896 ERR(
"Destroy Window WH_CBT Call Hook return!\n");
2939 if ((pwndTemp =
Window->spwndOwner))
2960 if (
Window->head.pti->MessageQueue->spwndActive ==
Window)
2961 Window->head.pti->MessageQueue->spwndActive =
NULL;
2962 if (
Window->head.pti->MessageQueue->spwndFocus ==
Window)
2963 Window->head.pti->MessageQueue->spwndFocus =
NULL;
2964 if (
Window->head.pti->MessageQueue->spwndActivePrev ==
Window)
2965 Window->head.pti->MessageQueue->spwndActivePrev =
NULL;
2966 if (
Window->head.pti->MessageQueue->spwndCapture ==
Window)
2967 Window->head.pti->MessageQueue->spwndCapture =
NULL;
2977 ERR(
"Destroying the ShellWindow!\n");
3046 TRACE(
"Enter NtUserDestroyWindow\n");
3057 TRACE(
"Leave NtUserDestroyWindow, ret=%u\n",
ret);
3069 BOOL CheckWindowName;
3076 CheckWindowName = WindowName->
Buffer != 0;
3100 if (!ClassAtom ||
Child->pcls->atomNVClassName == ClassAtom)
3106 if(!CheckWindowName ||
3107 (
Child->strName.Length < 0xFFFF &&
3147 HWND hwndChildAfter,
3158 TRACE(
"Enter NtUserFindWindowEx\n");
3161 if (ucClassName !=
NULL || ucWindowName !=
NULL)
3165 if (ucClassName !=
NULL)
3168 if (ClassName.
Length != 0)
3180 if (!IntGetAtomFromStringOrAtom(&ClassName,
3188 if (ucWindowName !=
NULL)
3191 if (WindowName.Length != 0)
3206 if (ucClassName !=
NULL)
3227 DoMessageWnd =
TRUE;
3250 PWND TopLevelWindow;
3269 CheckWindowName = WindowName.Buffer != 0;
3287 WindowMatches = !CheckWindowName ||
3290 ClassMatches = (ClassAtom == (
RTL_ATOM)0) ||
3293 if (WindowMatches && ClassMatches)
3313 TRACE(
"FindWindowEx: Not Desktop Parent!\n");
3317 if (Ret ==
NULL && DoMessageWnd)
3323 Ret =
IntFindWindow(MsgWindows, ChildAfter, ClassAtom, &WindowName);
3335 TRACE(
"Leave NtUserFindWindowEx, ret %p\n", Ret);
3418 TRACE(
"Enter NtUserGetAncestor\n");
3430 TRACE(
"Leave NtUserGetAncestor, ret=%p\n", Ret);
3452 INT fixedOwnerDrawHeight;
3465#define CBF_BUTTONDOWN 0x0002
3480 TRACE(
"Enter NtUserGetComboBoxInfo\n");
3515 NotSameppi = ppi != Wnd->
head.pti->ppi;
3544 TRACE(
"Leave NtUserGetComboBoxInfo, ret=%i\n", Ret);
3590 TRACE(
"Enter NtUserGetListBoxInfo\n");
3606 NotSameppi = ppi != Wnd->
head.pti->ppi;
3616 Ret =
descr->page_size;
3627 TRACE(
"Leave NtUserGetListBoxInfo, ret=%lu\n", Ret);
3654 TRACE(
"Enter NtUserSetParent\n");
3671 TRACE(
"Leave NtUserSetParent, ret=%p\n", Ret);
3720 PWND WndShell, WndListView;
3726 TRACE(
"Enter NtUserSetShellWindowEx\n");
3796 ti->
pDeskInfo->hShellWindow = hwndShell;
3798 ti->
pDeskInfo->spwndBkGnd = WndListView;
3810 TRACE(
"Leave NtUserSetShellWindowEx, ret=%i\n", Ret);
3881 ERR(
"NtUserSetWindowLong(): Index requires pointer size: %lu\n",
Index);
3892 Style.styleOld = OldValue;
3893 Style.styleNew = NewValue;
3900 WindowStation =
Window->head.pti->rpdesk->rpwinstaParent;
3904 Style.styleNew &= ~WS_EX_TOPMOST;
3924 Style.styleOld = OldValue;
3925 Style.styleNew = NewValue;
3938 Window->ExStyle &= ~WS_EX_WINDOWEDGE;
3945 ERR(
"IDMenu going null! %d\n",
Window->IDMenu);
3954 Window->state &= ~WNDS_HASMENU;
3957 ERR(
"IDMenu released 0x%p\n",pMenu);
4009 OldValue =
Window->dwUserData;
4010 Window->dwUserData = NewValue;
4014 ERR(
"NtUserSetWindowLong(): Unsupported index %lu\n",
Index);
4129 TRACE(
"Enter NtUserSetWindowWord\n");
4171 TRACE(
"Leave NtUserSetWindowWord, ret=%u\n", Ret);
4197#define GWLP_CONSOLE_LEADER_PID 0
4198#define GWLP_CONSOLE_LEADER_TID 4
4201 PWND pWnd, pwndActive;
4204 TRACE(
"Enter NtUserQueryWindow\n");
4265 if (pWnd->
head.pti->spwndDefaultIme)
4270 if (pWnd->
head.pti->spDefaultImc)
4281 ptiActive = pwndActive->
head.pti;
4290 TRACE(
"Leave NtUserQueryWindow, ret=%u\n",
Result);
4305 TRACE(
"Enter NtUserRegisterWindowMessage\n");
4308 if(MessageNameUnsafe ==
NULL)
4322 if (SafeMessageName.
Buffer)
4326 TRACE(
"Leave NtUserRegisterWindowMessage, ret=%u\n", Ret);
4341 TRACE(
"Enter NtUserSetWindowFNID\n");
4359 if (fnID < FNID_FIRST || fnID >
FNID_GHOST ||
4371 TRACE(
"Leave NtUserSetWindowFNID\n");
4465 TRACE(
"Enter NtUserDefSetText\n");
4467 if (WindowText !=
NULL)
4471 SafeText = ProbeForReadLargeString(WindowText);
4514 if (!Ret)
goto Exit;
4579 TRACE(
"Leave NtUserDefSetText, ret=%i\n", Ret);
4598 TRACE(
"Enter NtUserInternalGetWindowText\n");