ReactOS  0.4.15-dev-5463-g138eb58
window.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagWINDOWLIST
 

Macros

#define HAS_DLGFRAME(Style, ExStyle)
 
#define HAS_THICKFRAME(Style, ExStyle)
 
#define HAS_THINFRAME(Style, ExStyle)   (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
 
#define HAS_CLIENTFRAME(Style, ExStyle)   (((ExStyle) & WS_EX_CLIENTEDGE) || (!((Style) & (WS_CHILD | WS_POPUP))))
 
#define HAS_MENU(pWnd, style)   ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && (pWnd->IDMenu) && IntIsMenu(UlongToHandle(pWnd->IDMenu)))
 
#define IntIsDesktopWindow(WndObj)   (WndObj->spwndParent == NULL)
 
#define IntIsBroadcastHwnd(hWnd)   (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
 
#define IntWndBelongsToThread(WndObj, W32Thread)   ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
 
#define IntGetWndThreadId(WndObj)   PsGetThreadId(WndObj->head.pti->pEThread)
 
#define IntGetWndProcessId(WndObj)   PsGetProcessId(WndObj->head.pti->ppi->peProcess)
 
#define WINVER_WIN2K   _WIN32_WINNT_WIN2K
 
#define WINVER_WINNT4   _WIN32_WINNT_NT4
 
#define WINVER_WIN31   0x30A
 
#define HWND_TERMINATOR   ((HWND)(ULONG_PTR)1)
 
#define WL_IS_BAD(pwl)   ((pwl)->phwndEnd <= (pwl)->phwndLast)
 
#define WL_CAPACITY(pwl)   ((pwl)->phwndEnd - &((pwl)->ahwnd[0]))
 
#define IACE_LIST   0x0002
 
#define IS_WND_CHILD(pWnd)   ((pWnd)->style & WS_CHILD)
 
#define IS_WND_MENU(pWnd)   ((pWnd)->pcls->atomClassName == gpsi->atomSysClass[ICLS_MENU])
 
#define IS_WND_IMELIKE(pWnd)
 

Typedefs

typedef struct tagWINDOWLIST WINDOWLIST
 
typedef struct tagWINDOWLISTPWINDOWLIST
 

Functions

PWND FASTCALL ValidateHwndNoErr (HWND)
 
BOOL FASTCALL UserUpdateUiState (PWND Wnd, WPARAM wParam)
 
BOOL FASTCALL IntIsWindow (HWND hWnd)
 
HWND *FASTCALL IntWinListChildren (PWND Window)
 
HWND *FASTCALL IntWinListOwnedPopups (PWND Window)
 
VOID FASTCALL IntGetClientRect (PWND WindowObject, RECTL *Rect)
 
INT FASTCALL IntMapWindowPoints (PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints)
 
BOOL FASTCALL IntIsChildWindow (PWND Parent, PWND Child)
 
VOID FASTCALL IntUnlinkWindow (PWND Wnd)
 
VOID FASTCALL IntLinkHwnd (PWND Wnd, HWND hWndPrev)
 
PWND FASTCALL IntGetParent (PWND Wnd)
 
VOID FASTCALL IntGetWindowBorderMeasures (PWND WindowObject, UINT *cx, UINT *cy)
 
BOOL FASTCALL IntShowOwnedPopups (PWND owner, BOOL fShow)
 
LRESULT FASTCALL IntDefWindowProc (PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi)
 
VOID FASTCALL IntNotifyWinEvent (DWORD, PWND, LONG, LONG, DWORD)
 
PWND FASTCALL IntCreateWindow (CREATESTRUCTW *Cs, PLARGE_STRING WindowName, PCLS Class, PWND ParentWindow, PWND OwnerWindow, PVOID acbiBuffer, PDESKTOP pdeskCreated, DWORD dwVer)
 
PWND FASTCALL co_UserCreateWindowEx (CREATESTRUCTW *Cs, PUNICODE_STRING ClassName, PLARGE_STRING WindowName, PVOID acbiBuffer, DWORD dwVer)
 
BOOL FASTCALL IntEnableWindow (HWND, BOOL)
 
BOOL FASTCALL IntIsWindowVisible (PWND)
 
DWORD FASTCALL GetNCHitEx (PWND, POINT)
 
ULONG FASTCALL IntSetStyle (PWND, ULONG, ULONG)
 
PWND FASTCALL VerifyWnd (PWND)
 
PWND FASTCALL IntGetNonChildAncestor (PWND)
 
LONG FASTCALL co_UserSetWindowLong (HWND, DWORD, LONG, BOOL)
 
LONG_PTR FASTCALL co_UserSetWindowLongPtr (HWND, DWORD, LONG_PTR, BOOL)
 
HWND FASTCALL IntGetWindow (HWND, UINT)
 
LRESULT co_UserFreeWindow (PWND, PPROCESSINFO, PTHREADINFO, BOOLEAN)
 
PWINDOWLIST FASTCALL IntBuildHwndList (PWND pwnd, DWORD dwFlags, PTHREADINFO pti)
 
VOID FASTCALL IntFreeHwndList (PWINDOWLIST pwlTarget)
 
HWND FASTCALL IntFindWindow (PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom, PUNICODE_STRING WindowName)
 
BOOL FASTCALL IntWantImeWindow (PWND pwndTarget)
 
PWND FASTCALL co_IntCreateDefaultImeWindow (PWND pwndTarget, HINSTANCE hInst)
 
BOOL FASTCALL IntImeCanDestroyDefIMEforChild (PWND pImeWnd, PWND pwndTarget)
 
BOOL FASTCALL IntImeCanDestroyDefIME (PWND pImeWnd, PWND pwndTarget)
 
BOOL FASTCALL IntBroadcastImeShowStatusChange (PWND pImeWnd, BOOL bShow)
 
VOID FASTCALL IntNotifyImeShowStatus (PWND pImeWnd)
 
VOID FASTCALL IntCheckImeShowStatusInThread (PWND pImeWnd)
 

Variables

ATOM AtomMessage
 
ATOM AtomWndObj
 
ATOM AtomLayer
 
ATOM AtomFlashWndState
 
PWINDOWLIST gpwlList
 
PWINDOWLIST gpwlCache
 
BOOL gfIMEShowStatus
 

Macro Definition Documentation

◆ HAS_CLIENTFRAME

#define HAS_CLIENTFRAME (   Style,
  ExStyle 
)    (((ExStyle) & WS_EX_CLIENTEDGE) || (!((Style) & (WS_CHILD | WS_POPUP))))

Definition at line 19 of file window.h.

◆ HAS_DLGFRAME

#define HAS_DLGFRAME (   Style,
  ExStyle 
)
Value:
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
#define WS_THICKFRAME
Definition: pedump.c:630
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
const DWORD Style
Definition: appswitch.c:71
const DWORD ExStyle
Definition: appswitch.c:72

Definition at line 8 of file window.h.

◆ HAS_MENU

#define HAS_MENU (   pWnd,
  style 
)    ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && (pWnd->IDMenu) && IntIsMenu(UlongToHandle(pWnd->IDMenu)))

Definition at line 22 of file window.h.

◆ HAS_THICKFRAME

#define HAS_THICKFRAME (   Style,
  ExStyle 
)
Value:
(((Style) & WS_THICKFRAME) && \
#define WS_THICKFRAME
Definition: pedump.c:630
#define WS_DLGFRAME
Definition: pedump.c:626
const DWORD Style
Definition: appswitch.c:71
#define WS_BORDER
Definition: pedump.c:625

Definition at line 12 of file window.h.

◆ HAS_THINFRAME

#define HAS_THINFRAME (   Style,
  ExStyle 
)    (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))

Definition at line 16 of file window.h.

◆ HWND_TERMINATOR

#define HWND_TERMINATOR   ((HWND)(ULONG_PTR)1)

Definition at line 82 of file window.h.

◆ IACE_LIST

#define IACE_LIST   0x0002

Definition at line 105 of file window.h.

◆ IntGetWndProcessId

#define IntGetWndProcessId (   WndObj)    PsGetProcessId(WndObj->head.pti->ppi->peProcess)

Definition at line 37 of file window.h.

◆ IntGetWndThreadId

#define IntGetWndThreadId (   WndObj)    PsGetThreadId(WndObj->head.pti->pEThread)

Definition at line 34 of file window.h.

◆ IntIsBroadcastHwnd

#define IntIsBroadcastHwnd (   hWnd)    (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)

Definition at line 27 of file window.h.

◆ IntIsDesktopWindow

#define IntIsDesktopWindow (   WndObj)    (WndObj->spwndParent == NULL)

Definition at line 24 of file window.h.

◆ IntWndBelongsToThread

#define IntWndBelongsToThread (   WndObj,
  W32Thread 
)    ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))

Definition at line 31 of file window.h.

◆ IS_WND_CHILD

#define IS_WND_CHILD (   pWnd)    ((pWnd)->style & WS_CHILD)

Definition at line 107 of file window.h.

◆ IS_WND_IMELIKE

#define IS_WND_IMELIKE (   pWnd)
Value:
(((pWnd)->pcls->style & CS_IME) || \
((pWnd)->pcls->atomClassName == gpsi->atomSysClass[ICLS_IME]))
#define CS_IME
Definition: winuser.h:654
PSERVERINFO gpsi
Definition: imm.c:18
#define ICLS_IME
Definition: ntuser.h:922
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1055

Definition at line 113 of file window.h.

◆ IS_WND_MENU

#define IS_WND_MENU (   pWnd)    ((pWnd)->pcls->atomClassName == gpsi->atomSysClass[ICLS_MENU])

Definition at line 108 of file window.h.

◆ WINVER_WIN2K

#define WINVER_WIN2K   _WIN32_WINNT_WIN2K

Definition at line 55 of file window.h.

◆ WINVER_WIN31

#define WINVER_WIN31   0x30A

Definition at line 57 of file window.h.

◆ WINVER_WINNT4

#define WINVER_WINNT4   _WIN32_WINNT_NT4

Definition at line 56 of file window.h.

◆ WL_CAPACITY

#define WL_CAPACITY (   pwl)    ((pwl)->phwndEnd - &((pwl)->ahwnd[0]))

Definition at line 97 of file window.h.

◆ WL_IS_BAD

#define WL_IS_BAD (   pwl)    ((pwl)->phwndEnd <= (pwl)->phwndLast)

Definition at line 96 of file window.h.

Typedef Documentation

◆ PWINDOWLIST

◆ WINDOWLIST

Function Documentation

◆ co_IntCreateDefaultImeWindow()

PWND FASTCALL co_IntCreateDefaultImeWindow ( PWND  pwndTarget,
HINSTANCE  hInst 
)

Definition at line 1964 of file ime.c.

1965 {
1966  LARGE_UNICODE_STRING WindowName;
1967  UNICODE_STRING ClassName;
1968  PWND pImeWnd;
1969  PIMEUI pimeui;
1970  CREATESTRUCTW Cs;
1973  HANDLE pid = PsGetThreadProcessId(pti->pEThread);
1974 
1975  if (!(pti->spDefaultImc) && pid == gpidLogon)
1977 
1978  if (!(pti->spDefaultImc) || IS_WND_IMELIKE(pwndTarget) || !(pti->rpdesk->pheapDesktop))
1979  return NULL;
1980 
1981  if (IS_WND_CHILD(pwndTarget) && !(pwndTarget->style & WS_VISIBLE) &&
1982  pwndTarget->spwndParent->head.pti->ppi != pti->ppi)
1983  {
1984  return NULL;
1985  }
1986 
1987  RtlInitLargeUnicodeString(&WindowName, L"Default IME", 0);
1988 
1989  ClassName.Buffer = (PWCH)(ULONG_PTR)gpsi->atomSysClass[ICLS_IME];
1990  ClassName.Length = 0;
1991  ClassName.MaximumLength = 0;
1992 
1993  UserRefObjectCo(pwndTarget, &Ref);
1994 
1995  RtlZeroMemory(&Cs, sizeof(Cs));
1996  Cs.style = WS_POPUP | WS_DISABLED;
1997  Cs.hInstance = hInst;
1998  Cs.hwndParent = UserHMGetHandle(pwndTarget);
1999  Cs.lpszName = WindowName.Buffer;
2000  Cs.lpszClass = ClassName.Buffer;
2001 
2002  // NOTE: LARGE_UNICODE_STRING is compatible to LARGE_STRING.
2003  pImeWnd = co_UserCreateWindowEx(&Cs, &ClassName, (PLARGE_STRING)&WindowName, NULL, WINVER);
2004  if (pImeWnd)
2005  {
2006  pimeui = ((PIMEWND)pImeWnd)->pimeui;
2007  _SEH2_TRY
2008  {
2009  ProbeForWrite(pimeui, sizeof(IMEUI), 1);
2010  pimeui->fDefault = TRUE;
2011  if (IS_WND_CHILD(pwndTarget) && pwndTarget->spwndParent->head.pti != pti)
2012  pimeui->fChildThreadDef = TRUE;
2013  }
2015  {
2016  NOTHING;
2017  }
2018  _SEH2_END;
2019  }
2020 
2021  UserDerefObjectCo(pwndTarget);
2022  return pImeWnd;
2023 }
_SEH2_TRY
Definition: create.c:4226
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
Definition: rtlstr.c:42
#define WS_DISABLED
Definition: pedump.c:621
#define IS_WND_CHILD(pWnd)
Definition: window.h:107
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define NOTHING
Definition: input_list.c:10
struct tagIMC * spDefaultImc
Definition: win32.h:132
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define WINVER
Definition: targetver.h:11
PSERVERINFO gpsi
Definition: imm.c:18
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
_SEH2_END
Definition: create.c:4400
struct _DESKTOP * rpdesk
Definition: win32.h:92
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
PPROCESSINFO ppi
Definition: win32.h:88
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define L(x)
Definition: ntvdm.h:50
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
Definition: object.h:3
HINSTANCE hInstance
Definition: winuser.h:2946
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HANDLE NTAPI PsGetThreadProcessId(IN PETHREAD Thread)
Definition: thread.c:745
WCHAR * PWCH
Definition: ntbasedef.h:410
UINT fChildThreadDef
Definition: ntuser.h:1248
#define ICLS_IME
Definition: ntuser.h:922
LPCWSTR lpszName
Definition: winuser.h:2954
Definition: ntuser.h:688
struct _IMEWND * PIMEWND
HINSTANCE hInst
Definition: dxdiag.c:13
UINT fDefault
Definition: ntuser.h:1247
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
#define IS_WND_IMELIKE(pWnd)
Definition: window.h:113
struct _WND * spwndParent
Definition: ntuser.h:708
LPCWSTR lpszClass
Definition: winuser.h:2955
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define WS_VISIBLE
Definition: pedump.c:620
PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
Definition: ime.c:1565
HANDLE gpidLogon
Definition: simplecall.c:15
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW *Cs, PUNICODE_STRING ClassName, PLARGE_STRING WindowName, PVOID acbiBuffer, DWORD dwVer)
Definition: window.c:2185
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1055
DWORD style
Definition: ntuser.h:701

Referenced by IntCreateWindow().

◆ co_UserCreateWindowEx()

PWND FASTCALL co_UserCreateWindowEx ( CREATESTRUCTW Cs,
PUNICODE_STRING  ClassName,
PLARGE_STRING  WindowName,
PVOID  acbiBuffer,
DWORD  dwVer 
)

Definition at line 2185 of file window.c.

2190 {
2191  ULONG style;
2192  PWND Window = NULL, ParentWindow = NULL, OwnerWindow;
2193  HWND hWnd, hWndParent, hWndOwner, hwndInsertAfter;
2194  PWINSTATION_OBJECT WinSta;
2195  PCLS Class = NULL;
2196  SIZE Size;
2197  POINT MaxSize, MaxPos, MinTrack, MaxTrack;
2198  CBT_CREATEWNDW * pCbtCreate;
2199  LRESULT Result;
2200  USER_REFERENCE_ENTRY ParentRef, Ref;
2201  PTHREADINFO pti;
2202  DWORD dwShowMode = SW_SHOW;
2203  CREATESTRUCTW *pCsw = NULL;
2204  PVOID pszClass = NULL, pszName = NULL;
2205  PWND ret = NULL;
2206 
2207  /* Get the current window station and reference it */
2208  pti = GetW32ThreadInfo();
2209  if (pti == NULL || pti->rpdesk == NULL)
2210  {
2211  ERR("Thread is not attached to a desktop! Cannot create window!\n");
2212  return NULL; // There is nothing to cleanup.
2213  }
2214  WinSta = pti->rpdesk->rpwinstaParent;
2216 
2217  pCsw = NULL;
2218  pCbtCreate = NULL;
2219 
2220  /* Get the class and reference it */
2221  Class = IntGetAndReferenceClass(ClassName, Cs->hInstance, FALSE);
2222  if(!Class)
2223  {
2225  ERR("Failed to find class %wZ\n", ClassName);
2226  goto cleanup;
2227  }
2228 
2229  /* Now find the parent and the owner window */
2230  hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h;
2231  hWndOwner = NULL;
2232 
2233  if (Cs->hwndParent == HWND_MESSAGE)
2234  {
2235  Cs->hwndParent = hWndParent = pti->rpdesk->spwndMessage->head.h;
2236  }
2237  else if (Cs->hwndParent)
2238  {
2239  if ((Cs->style & (WS_CHILD|WS_POPUP)) != WS_CHILD)
2240  hWndOwner = Cs->hwndParent;
2241  else
2242  hWndParent = Cs->hwndParent;
2243  }
2244  else if ((Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
2245  {
2246  ERR("Cannot create a child window without a parent!\n");
2248  goto cleanup; /* WS_CHILD needs a parent, but WS_POPUP doesn't */
2249  }
2251  (IS_INTRESOURCE(Cs->lpszClass) ||
2252  Cs->lpszClass != (LPCWSTR)MAKEINTATOM(gpsi->atomSysClass[ICLS_HWNDMESSAGE]) ||
2253  _wcsicmp(Cs->lpszClass, L"Message") != 0))
2254  {
2255  if (pti->ppi->dwLayout & LAYOUT_RTL)
2256  {
2257  Cs->dwExStyle |= WS_EX_LAYOUTRTL;
2258  }
2259  }
2260 
2261  ParentWindow = hWndParent ? UserGetWindowObject(hWndParent): NULL;
2262  OwnerWindow = hWndOwner ? UserGetWindowObject(hWndOwner): NULL;
2263 
2264  if (hWndParent && !ParentWindow)
2265  {
2266  ERR("Got invalid parent window handle\n");
2267  goto cleanup;
2268  }
2269  else if (hWndOwner && !OwnerWindow)
2270  {
2271  ERR("Got invalid owner window handle\n");
2272  ParentWindow = NULL;
2273  goto cleanup;
2274  }
2275 
2276  if(OwnerWindow)
2277  {
2278  if (IntIsDesktopWindow(OwnerWindow)) OwnerWindow = NULL;
2279  else if (ParentWindow && !IntIsDesktopWindow(ParentWindow))
2280  {
2281  ERR("an owned window must be created as top-level\n");
2283  goto cleanup;
2284  }
2285  else /* owner must be a top-level window */
2286  {
2287  while ((OwnerWindow->style & (WS_POPUP|WS_CHILD)) == WS_CHILD && !IntIsDesktopWindow(OwnerWindow->spwndParent))
2288  OwnerWindow = OwnerWindow->spwndParent;
2289  }
2290  }
2291 
2292  /* Fix the position and the size of the window */
2293  if (ParentWindow)
2294  {
2295  UserRefObjectCo(ParentWindow, &ParentRef);
2296  IntFixWindowCoordinates(Cs, ParentWindow, &dwShowMode);
2297  }
2298 
2299  /* Allocate and initialize the new window */
2300  Window = IntCreateWindow(Cs,
2301  WindowName,
2302  Class,
2303  ParentWindow,
2304  OwnerWindow,
2305  acbiBuffer,
2306  NULL,
2307  dwVer );
2308  if(!Window)
2309  {
2310  ERR("IntCreateWindow failed!\n");
2311  goto cleanup;
2312  }
2313 
2315  hwndInsertAfter = HWND_TOP;
2316 
2317  UserRefObjectCo(Window, &Ref);
2319  ObDereferenceObject(WinSta);
2320 
2321  /* NCCREATE, WM_NCCALCSIZE and Hooks need the original values */
2322  Cs->lpszName = (LPCWSTR) WindowName;
2323  Cs->lpszClass = (LPCWSTR) ClassName;
2324 
2326  if ( ISITHOOKED(WH_CBT) || (pti->rpdesk->pDeskInfo->fsHooks & HOOKID_TO_FLAG(WH_CBT)) )
2327  {
2328  // Allocate the calling structures Justin Case this goes Global.
2331  if (!pCsw || !pCbtCreate)
2332  {
2333  ERR("UserHeapAlloc() failed!\n");
2334  goto cleanup;
2335  }
2336 
2337  if (!IntMsgCreateStructW( Window, pCsw, Cs, &pszClass, &pszName ) )
2338  {
2339  ERR("IntMsgCreateStructW() failed!\n");
2340  goto cleanup;
2341  }
2342 
2343  pCbtCreate->lpcs = pCsw;
2344  pCbtCreate->hwndInsertAfter = hwndInsertAfter;
2345 
2348  if (Result != 0)
2349  {
2350  ERR("WH_CBT HCBT_CREATEWND hook failed! 0x%x\n", Result);
2351  goto cleanup;
2352  }
2353  // Write back changes.
2354  Cs->cx = pCsw->cx;
2355  Cs->cy = pCsw->cy;
2356  Cs->x = pCsw->x;
2357  Cs->y = pCsw->y;
2358  hwndInsertAfter = pCbtCreate->hwndInsertAfter;
2359  }
2360 
2361  if ((Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
2362  {
2363  if (ParentWindow != co_GetDesktopWindow(Window))
2364  {
2365  Cs->x += ParentWindow->rcClient.left;
2366  Cs->y += ParentWindow->rcClient.top;
2367  }
2368  }
2369 
2370  /* Send the WM_GETMINMAXINFO message */
2371  Size.cx = Cs->cx;
2372  Size.cy = Cs->cy;
2373 
2374  if ((Cs->style & WS_THICKFRAME) || !(Cs->style & (WS_POPUP | WS_CHILD)))
2375  {
2376  co_WinPosGetMinMaxInfo(Window, &MaxSize, &MaxPos, &MinTrack, &MaxTrack);
2377  if (Size.cx > MaxTrack.x) Size.cx = MaxTrack.x;
2378  if (Size.cy > MaxTrack.y) Size.cy = MaxTrack.y;
2379  if (Size.cx < MinTrack.x) Size.cx = MinTrack.x;
2380  if (Size.cy < MinTrack.y) Size.cy = MinTrack.y;
2381  }
2382 
2383  Window->rcWindow.left = Cs->x;
2384  Window->rcWindow.top = Cs->y;
2385  Window->rcWindow.right = Cs->x + Size.cx;
2386  Window->rcWindow.bottom = Cs->y + Size.cy;
2387  /*
2388  if (0 != (Window->style & WS_CHILD) && ParentWindow)
2389  {
2390  ERR("co_UserCreateWindowEx(): Offset rcWindow\n");
2391  RECTL_vOffsetRect(&Window->rcWindow,
2392  ParentWindow->rcClient.left,
2393  ParentWindow->rcClient.top);
2394  }
2395  */
2396  /* correct child window coordinates if mirroring on parent is enabled */
2397  if (ParentWindow != NULL)
2398  {
2399  if ( ((Cs->style & WS_CHILD) == WS_CHILD) &&
2400  ((ParentWindow->ExStyle & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL))
2401  {
2402  Window->rcWindow.right = ParentWindow->rcClient.right - (Window->rcWindow.left - ParentWindow->rcClient.left);
2403  Window->rcWindow.left = Window->rcWindow.right - Size.cx;
2404  }
2405  }
2406 
2407  Window->rcClient = Window->rcWindow;
2408 
2409  if (Window->spwndNext || Window->spwndPrev)
2410  {
2411  ERR("Window 0x%p has been linked too early!\n", Window);
2412  }
2413 
2414  if (!(Window->state2 & WNDS2_WIN31COMPAT))
2415  {
2416  if (Class->style & CS_PARENTDC && !(ParentWindow->style & WS_CLIPCHILDREN))
2417  Window->style &= ~(WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
2418  }
2419 
2420  if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
2421  {
2422  if ( !IntIsTopLevelWindow(Window) )
2423  {
2424  if (pti != ParentWindow->head.pti)
2425  {
2426  //ERR("CreateWindow Parent in.\n");
2427  UserAttachThreadInput(pti, ParentWindow->head.pti, TRUE);
2428  }
2429  }
2430  }
2431 
2432  /* Send the NCCREATE message */
2434  if (!Result)
2435  {
2436  ERR("co_UserCreateWindowEx(): NCCREATE message failed\n");
2437  goto cleanup;
2438  }
2439 
2440  /* Link the window */
2441  if (ParentWindow != NULL)
2442  {
2443  /* Link the window into the siblings list */
2444  if ((Cs->style & (WS_CHILD | WS_MAXIMIZE)) == WS_CHILD)
2446  else
2447  IntLinkHwnd(Window, hwndInsertAfter);
2448  }
2449 
2450  /* Send the WM_NCCALCSIZE message */
2451  {
2452  // RECT rc;
2453  MaxPos.x = Window->rcWindow.left;
2454  MaxPos.y = Window->rcWindow.top;
2455 
2456  Result = co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient);
2457  //rc = Window->rcWindow;
2458  //Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM)&rc);
2459  //Window->rcClient = rc;
2460 
2461  RECTL_vOffsetRect(&Window->rcWindow, MaxPos.x - Window->rcWindow.left,
2462  MaxPos.y - Window->rcWindow.top);
2463  }
2464 
2465  /* Send the WM_CREATE message. */
2467  if (Result == (LRESULT)-1)
2468  {
2469  ERR("co_UserCreateWindowEx(): WM_CREATE message failed\n");
2470  goto cleanup;
2471  }
2472 
2473  /* Send the EVENT_OBJECT_CREATE event */
2474  IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_WINDOW, CHILDID_SELF, 0);
2475 
2476  /* By setting the flag below it can be examined to determine if the window
2477  was created successfully and a valid pwnd was passed back to caller since
2478  from here the function has to succeed. */
2480 
2481  /* Send the WM_SIZE and WM_MOVE messages. */
2482  if (!(Window->state & WNDS_SENDSIZEMOVEMSGS))
2483  {
2485  }
2486 
2487  /* Show or maybe minimize or maximize the window. */
2488 
2490  if (style & (WS_MINIMIZE | WS_MAXIMIZE))
2491  {
2492  RECTL NewPos;
2493  UINT SwFlag = (style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
2494 
2495  SwFlag = co_WinPosMinMaximize(Window, SwFlag, &NewPos);
2496  SwFlag |= SWP_NOZORDER|SWP_FRAMECHANGED; /* Frame always gets changed */
2497  if (!(style & WS_VISIBLE) || (style & WS_CHILD) || UserGetActiveWindow() ||
2498  (Window->ExStyle & WS_EX_NOACTIVATE))
2499  {
2500  SwFlag |= SWP_NOACTIVATE;
2501  }
2502  co_WinPosSetWindowPos(Window, 0, NewPos.left, NewPos.top,
2503  NewPos.right, NewPos.bottom, SwFlag);
2504  }
2505 
2506  /* Send the WM_PARENTNOTIFY message */
2508 
2509  /* Notify the shell that a new window was created */
2510  if (Window->spwndOwner == NULL ||
2511  !(Window->spwndOwner->style & WS_VISIBLE) ||
2512  (Window->spwndOwner->ExStyle & WS_EX_TOOLWINDOW))
2513  {
2514  if (UserIsDesktopWindow(Window->spwndParent) &&
2515  (Window->style & WS_VISIBLE) &&
2516  (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
2517  (Window->ExStyle & WS_EX_APPWINDOW)))
2518  {
2520  }
2521  }
2522 
2523  /* Initialize and show the window's scrollbars */
2524  if (Window->style & WS_VSCROLL)
2525  {
2527  }
2528  if (Window->style & WS_HSCROLL)
2529  {
2531  }
2532 
2533  /* Show the new window */
2534  if (Cs->style & WS_VISIBLE)
2535  {
2536  if (Window->style & WS_MAXIMIZE)
2537  dwShowMode = SW_SHOW;
2538  else if (Window->style & WS_MINIMIZE)
2539  dwShowMode = SW_SHOWMINIMIZED;
2540 
2541  co_WinPosShowWindow(Window, dwShowMode);
2542 
2543  if (Window->ExStyle & WS_EX_MDICHILD)
2544  {
2545  ASSERT(ParentWindow);
2546  if(!ParentWindow)
2547  goto cleanup;
2548  co_IntSendMessage(UserHMGetHandle(ParentWindow), WM_MDIREFRESHMENU, 0, 0);
2549  /* ShowWindow won't activate child windows */
2551  }
2552  }
2553 
2554  if (Class->atomClassName == gaGuiConsoleWndClass)
2555  {
2556  /* Count only console windows manually */
2558  }
2559 
2560  TRACE("co_UserCreateWindowEx(): Created window %p\n", hWnd);
2561  ret = Window;
2562 
2563 cleanup:
2564  if (!ret)
2565  {
2566  TRACE("co_UserCreateWindowEx(): Error Created window!\n");
2567  /* If the window was created, the class will be dereferenced by co_UserDestroyWindow */
2568  if (Window)
2570  else if (Class)
2571  IntDereferenceClass(Class, pti->pDeskInfo, pti->ppi);
2572  }
2573 
2574  if (pCsw) ExFreePoolWithTag(pCsw, TAG_HOOK);
2575  if (pCbtCreate) ExFreePoolWithTag(pCbtCreate, TAG_HOOK);
2576  if (pszName) UserHeapFree(pszName);
2577  if (pszClass) UserHeapFree(pszClass);
2578 
2579  if (Window)
2580  {
2582  }
2583  if (ParentWindow) UserDerefObjectCo(ParentWindow);
2584 
2585  // See CORE-13717, not setting error on success.
2586  if (ret)
2588 
2589  return ret;
2590 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_THICKFRAME
Definition: pedump.c:630
#define HOOKID_TO_FLAG(HookId)
Definition: hook.h:5
#define HCBT_CREATEWND
Definition: winuser.h:58
POBJECT_TYPE ExWindowStationObjectType
Definition: win32k.c:21
long y
Definition: polytest.cpp:48
#define LAYOUT_RTL
Definition: wingdi.h:1371
#define ERROR_SUCCESS
Definition: deptool.c:10
NTSTATUS FASTCALL UserAttachThreadInput(PTHREADINFO ptiFrom, PTHREADINFO ptiTo, BOOL fAttach)
Definition: input.c:480
#define TAG_HOOK
Definition: tags.h:5
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
long x
Definition: polytest.cpp:48
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
HWND FASTCALL UserGetActiveWindow(VOID)
Definition: focus.c:1429
LPCREATESTRUCTW lpcs
Definition: winuser.h:2965
#define SB_HORZ
Definition: winuser.h:552
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1748
PSERVERINFO gpsi
Definition: imm.c:18
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
#define ICLS_DESKTOP
Definition: ntuser.h:924
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1245
long bottom
Definition: polytest.cpp:53
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:44
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
DWORD FASTCALL co_UserShowScrollBar(PWND, int, BOOL, BOOL)
Definition: scrollbar.c:951
#define HWND_TOP
Definition: winuser.h:1197
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
UINT_PTR WPARAM
Definition: windef.h:207
#define WNDS_SENDSIZEMOVEMSGS
Definition: ntuser.h:604
#define WS_CHILD
Definition: pedump.c:617
#define HWND_MESSAGE
Definition: winuser.h:1200
#define SWP_NOZORDER
Definition: winuser.h:1237
#define SW_SHOWMINIMIZED
Definition: winuser.h:765
#define WS_CLIPCHILDREN
Definition: pedump.c:619
ATOM gaGuiConsoleWndClass
Definition: ntuser.c:27
#define WM_NCCREATE
Definition: winuser.h:1673
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
struct _DESKTOP * rpdesk
Definition: win32.h:92
DWORD dwLayout
Definition: win32.h:279
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:801
PPROCESSINFO ppi
Definition: win32.h:88
HWND hwndInsertAfter
Definition: winuser.h:2966
long right
Definition: polytest.cpp:53
Definition: window.c:28
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define L(x)
Definition: ntvdm.h:50
VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
Definition: window.c:971
#define FALSE
Definition: types.h:117
#define WS_MINIMIZE
Definition: pedump.c:622
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
long top
Definition: polytest.cpp:53
#define CHILDID_SELF
Definition: winable.h:14
Definition: object.h:3
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
Definition: ntuser.h:560
LONG_PTR LPARAM
Definition: windef.h:208
PWND FASTCALL co_GetDesktopWindow(PWND pWnd)
Definition: desktop.c:1366
#define WH_CBT
Definition: winuser.h:35
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
Definition: obref.c:381
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define SW_SHOW
Definition: winuser.h:769
PWND FASTCALL IntCreateWindow(CREATESTRUCTW *Cs, PLARGE_STRING WindowName, PCLS Class, PWND ParentWindow, PWND OwnerWindow, PVOID acbiBuffer, PDESKTOP pdeskCreated, DWORD dwVer)
Definition: window.c:1787
long left
Definition: polytest.cpp:53
VOID FASTCALL co_IntUserManualGuiCheck(BOOL Create)
Definition: guicheck.c:77
UINT FASTCALL co_WinPosGetMinMaxInfo(PWND Window, POINT *MaxSize, POINT *MaxPos, POINT *MinTrack, POINT *MaxTrack)
Definition: winpos.c:933
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2518
BOOLEAN co_UserDestroyWindow(PVOID Object)
Definition: window.c:2845
HINSTANCE hInstance
Definition: winuser.h:2946
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define ERROR_TLW_WITH_WSCHILD
Definition: winerror.h:887
#define HWND_BOTTOM
Definition: winuser.h:1195
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define ASSERT(a)
Definition: mode.c:44
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define ISITHOOKED(HookId)
Definition: hook.h:6
PCLS IntGetAndReferenceClass(PUNICODE_STRING ClassName, HINSTANCE hInstance, BOOL bDesktopThread)
Definition: class.c:1437
#define ObDereferenceObject
Definition: obfuncs.h:203
void FASTCALL co_WinPosSendSizeMove(PWND Wnd)
Definition: winpos.c:2333
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WNDS2_WMCREATEMSGPROCESSED
Definition: ntuser.h:665
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define SW_MINIMIZE
Definition: winuser.h:770
int Window
Definition: x11stubs.h:26
#define WS_HSCROLL
Definition: pedump.c:628
BOOL FASTCALL IntIsTopLevelWindow(PWND pWnd)
Definition: window.c:354
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
Definition: hook.c:1103
int ret
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
LPCWSTR lpszName
Definition: winuser.h:2954
#define SWP_FRAMECHANGED
Definition: winuser.h:1230
#define SWP_NOSIZE
Definition: winuser.h:1235
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
Definition: rect.h:31
#define IntIsDesktopWindow(WndObj)
Definition: window.h:24
#define WM_MDIREFRESHMENU
Definition: winuser.h:1816
#define WNDS2_WIN31COMPAT
Definition: ntuser.h:644
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
#define WS_POPUP
Definition: pedump.c:616
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define WS_VSCROLL
Definition: pedump.c:627
#define SWP_SHOWWINDOW
Definition: winuser.h:1238
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:1692
UINT FASTCALL co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT *NewPos)
Definition: winpos.c:2367
VOID IntDereferenceClass(IN OUT PCLS Class, IN PDESKTOPINFO Desktop, IN PPROCESSINFO pi)
Definition: class.c:815
#define WM_CREATE
Definition: winuser.h:1598
LPCWSTR lpszClass
Definition: winuser.h:2955
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
Definition: window.c:147
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
#define SWP_NOMOVE
Definition: winuser.h:1234
#define WS_EX_APPWINDOW
Definition: winuser.h:383
LONG_PTR LRESULT
Definition: windef.h:209
struct _DESKTOPINFO * pDeskInfo
Definition: win32.h:93
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define SW_MAXIMIZE
Definition: winuser.h:766
BOOL FASTCALL IntMsgCreateStructW(PWND, CREATESTRUCTW *, CREATESTRUCTW *, PVOID *, PVOID *)
Definition: message.c:597
static void IntSendParentNotify(PWND pWindow, UINT msg)
Definition: window.c:1678
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
void FASTCALL IntFixWindowCoordinates(CREATESTRUCTW *Cs, PWND ParentWindow, DWORD *dwShowMode)
Definition: window.c:1697
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define CS_PARENTDC
Definition: winuser.h:651
#define MAKEINTATOM(i)
Definition: winbase.h:1451
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1055
LRESULT FASTCALL co_WinPosGetNonClientSize(PWND Window, RECT *WindowRect, RECT *ClientRect)
Definition: winpos.c:2318
#define WS_MAXIMIZE
Definition: pedump.c:623
#define ERROR_CANNOT_FIND_WND_CLASS
Definition: winerror.h:888

Referenced by co_IntCreateDefaultImeWindow(), MENU_InitPopup(), and NtUserCreateWindowEx().

◆ co_UserFreeWindow()

LRESULT co_UserFreeWindow ( PWND  ,
PPROCESSINFO  ,
PTHREADINFO  ,
BOOLEAN   
)

Definition at line 569 of file window.c.

573 {
574  HWND *Children;
575  HWND *ChildHandle;
576  PWND Child;
577  PMENU Menu;
578  BOOLEAN BelongsToThreadData;
579 
580  ASSERT(Window);
581 
582  if(Window->state2 & WNDS2_INDESTROY)
583  {
584  TRACE("Tried to call co_UserFreeWindow() twice\n");
585  return 0;
586  }
587  Window->state2 |= WNDS2_INDESTROY;
588  Window->style &= ~WS_VISIBLE;
589  Window->head.pti->cVisWindows--;
590 
591 
592  /* remove the window already at this point from the thread window list so we
593  don't get into trouble when destroying the thread windows while we're still
594  in co_UserFreeWindow() */
595  RemoveEntryList(&Window->ThreadListEntry);
596 
597  BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
598 
600 
601  /* free child windows */
602  Children = IntWinListChildren(Window);
603  if (Children)
604  {
605  for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
606  {
607  if ((Child = IntGetWindowObject(*ChildHandle)))
608  {
610  {
611  /* send WM_DESTROY messages to windows not belonging to the same thread */
613  }
614  else
615  co_UserFreeWindow(Child, ProcessData, ThreadData, SendMessages);
616 
618  }
619  }
621  }
622 
623  if (SendMessages)
624  {
625  /*
626  * Clear the update region to make sure no WM_PAINT messages will be
627  * generated for this window while processing the WM_NCDESTROY.
628  */
632  if (BelongsToThreadData)
634  }
635 
637 
639 
640  /* Unregister hot keys */
642 
643  /* flush the message queue */
645 
646  /* from now on no messages can be sent to this window anymore */
647  Window->state |= WNDS_DESTROYED;
648  Window->fnid |= FNID_FREED;
649 
650  /* don't remove the WINDOWSTATUS_DESTROYING bit */
651 
652  /* reset shell window handles */
653  if (ThreadData->rpdesk)
654  {
655  if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
656  ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL;
657 
658  if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellListView)
659  ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
660  }
661 
662  if (ThreadData->spwndDefaultIme &&
663  ThreadData->spwndDefaultIme->spwndOwner == Window)
664  {
665  ThreadData->spwndDefaultIme->spwndOwner = NULL;
666  }
667 
668  if (IS_IMM_MODE() && Window == ThreadData->spwndDefaultIme)
669  {
670  UserAssignmentUnlock((PVOID*)&(ThreadData->spwndDefaultIme));
671  }
672 
673  /* Fixes dialog test_focus breakage due to r66237. */
674  if (ThreadData->MessageQueue->spwndFocus == Window)
675  ThreadData->MessageQueue->spwndFocus = NULL;
676 
677  if (ThreadData->MessageQueue->spwndActive == Window)
678  ThreadData->MessageQueue->spwndActive = NULL;
679 
680  if (ThreadData->MessageQueue->spwndCapture == Window)
681  {
683  }
684 
686  if ( Window->hrgnUpdate != NULL || Window->state & WNDS_INTERNALPAINT )
687  {
688  MsqDecPaintCountQueue(Window->head.pti);
689  if (Window->hrgnUpdate > HRGN_WINDOW && GreIsHandleValid(Window->hrgnUpdate))
690  {
692  GreDeleteObject(Window->hrgnUpdate);
693  }
694  Window->hrgnUpdate = NULL;
695  Window->state &= ~WNDS_INTERNALPAINT;
696  }
697 
699  {
701  }
702 
703  if ( ((Window->style & (WS_CHILD|WS_POPUP)) != WS_CHILD) &&
704  Window->IDMenu &&
705  (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
706  {
707  TRACE("UFW: IDMenu %p\n",Window->IDMenu);
708  IntDestroyMenuObject(Menu, TRUE);
709  Window->IDMenu = 0;
710  }
711 
712  if (Window->SystemMenu
713  && (Menu = UserGetMenuObject(Window->SystemMenu)))
714  {
715  IntDestroyMenuObject(Menu, TRUE);
716  Window->SystemMenu = (HMENU)0;
717  }
718 
719  DceFreeWindowDCE(Window); /* Always do this to catch orphaned DCs */
720 
722 
723  if (Window->PropListItems)
724  {
726  TRACE("Window->PropListItems %lu\n",Window->PropListItems);
727  ASSERT(Window->PropListItems==0);
728  }
729 
732 
734 
735  if (Window->pcls->atomClassName == gaGuiConsoleWndClass)
736  {
737  /* Count only console windows manually */
739  }
740 
741  /* dereference the class */
742  NT_ASSERT(Window->head.pti != NULL);
744  Window->head.pti->pDeskInfo,
745  Window->head.pti->ppi);
746  Window->pcls = NULL;
747 
748  if (Window->hrgnClip)
749  {
751  GreDeleteObject(Window->hrgnClip);
752  Window->hrgnClip = NULL;
753  }
754  Window->head.pti->cWindows--;
755 
756 // ASSERT(Window != NULL);
757  UserFreeWindowInfo(Window->head.pti, Window);
758 
761 
762  return 0;
763 }
#define RDW_NOINTERNALPAINT
Definition: winuser.h:1207
#define RDW_NOCHILDREN
Definition: winuser.h:1212
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:717
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1158
LRESULT co_UserFreeWindow(PWND Window, PPROCESSINFO ProcessData, PTHREADINFO ThreadData, BOOLEAN SendMessages)
Definition: window.c:569
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1146
VOID FASTCALL IntUnlinkWindow(PWND Wnd)
Definition: window.c:1341
BOOL FASTCALL IntReleaseCapture(VOID)
Definition: focus.c:1530
#define IntWndBelongsToThread(WndObj, W32Thread)
Definition: window.h:31
#define TRUE
Definition: types.h:120
#define IS_IMM_MODE()
Definition: ntuser.h:1232
#define WNDS_SENDNCPAINT
Definition: ntuser.h:611
BOOL FASTCALL IntDestroyMenuObject(PMENU Menu, BOOL bRecurse)
Definition: menu.c:319
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
#define WS_CHILD
Definition: pedump.c:617
ATOM gaGuiConsoleWndClass
Definition: ntuser.c:27
PWND FASTCALL IntGetWindowObject(HWND hWnd)
Definition: window.c:73
FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
Definition: userfuncs.h:4
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
Definition: timer.c:522
Definition: window.c:28
#define FALSE
Definition: types.h:117
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:533
void FASTCALL DceFreeWindowDCE(PWND)
Definition: windc.c:686
unsigned char BOOLEAN
#define HRGN_WINDOW
Definition: ntuser.h:356
VOID FASTCALL UserClipboardFreeWindow(PWND pWindow)
Definition: clipboard.c:414
VOID FASTCALL co_IntUserManualGuiCheck(BOOL Create)
Definition: guicheck.c:77
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define TRACE(s)
Definition: solgame.cpp:4
BOOL IntDeRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1784
#define ASSERT(a)
Definition: mode.c:44
VOID FASTCALL UserRemoveWindowProps(_In_ PWND Window)
Definition: prop.c:115
BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
Definition: region.c:2478
#define WM_NCDESTROY
Definition: winuser.h:1674
VOID FASTCALL MsqDecPaintCountQueue(PTHREADINFO pti)
Definition: msgqueue.c:508
#define FNID_FREED
Definition: ntuser.h:895
#define RDW_VALIDATE
Definition: winuser.h:1208
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define RDW_NOERASE
Definition: winuser.h:1205
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:278
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define RDW_NOFRAME
Definition: winuser.h:1206
Definition: ntuser.h:688
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
BOOL FASTCALL IntDestroyScrollBars(PWND)
Definition: scrollbar.c:898
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
#define WNDS_INTERNALPAINT
Definition: ntuser.h:612
#define WNDS_SENDERASEBACKGROUND
Definition: ntuser.h:609
PVOID FASTCALL UserAssignmentUnlock(PVOID *ppvObj)
Definition: object.c:861
VOID IntDereferenceClass(IN OUT PCLS Class, IN PDESKTOPINFO Desktop, IN PPROCESSINFO pi)
Definition: class.c:815
#define USERTAG_WINDOWLIST
Definition: tags.h:298
#define WS_VISIBLE
Definition: pedump.c:620
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WNDS_DESTROYED
Definition: ntuser.h:631
VOID APIENTRY MsqRemoveWindowMessagesFromQueue(PWND Window)
Definition: msgqueue.c:798
#define WNDS2_INDESTROY
Definition: ntuser.h:643
VOID FASTCALL UnregisterWindowHotKeys(PWND pWnd)
Definition: hotkey.c:91
static VOID UserFreeWindowInfo(PTHREADINFO ti, PWND Wnd)
Definition: window.c:536
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731
#define NT_ASSERT
Definition: rtlfuncs.h:3310
BOOL FASTCALL UserMarkObjectDestroy(PVOID Object)
Definition: object.c:621

Referenced by co_UserDestroyWindow(), co_UserFreeWindow(), and handle_internal_message().

◆ co_UserSetWindowLong()

LONG FASTCALL co_UserSetWindowLong ( HWND  ,
DWORD  ,
LONG  ,
BOOL   
)

Definition at line 4014 of file window.c.

4015 {
4016  return (LONG)co_IntSetWindowLongPtr(hWnd, Index, NewValue, Ansi, sizeof(LONG), FALSE);
4017 }
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
static LONG_PTR co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULONG Size, BOOL bAlter)
Definition: window.c:3819
long LONG
Definition: pedump.c:60
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by DesktopWindowProc(), and NtUserSetWindowWord().

◆ co_UserSetWindowLongPtr()

LONG_PTR FASTCALL co_UserSetWindowLongPtr ( HWND  ,
DWORD  ,
LONG_PTR  ,
BOOL   
)

Definition at line 4020 of file window.c.

4021 {
4022  return co_IntSetWindowLongPtr(hWnd, Index, NewValue, Ansi, sizeof(LONG_PTR), FALSE);
4023 }
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
static LONG_PTR co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULONG Size, BOOL bAlter)
Definition: window.c:3819
_In_ WDFCOLLECTION _In_ ULONG Index
__int3264 LONG_PTR
Definition: mstsclib_h.h:276

◆ GetNCHitEx()

DWORD FASTCALL GetNCHitEx ( PWND  ,
POINT   
)

Definition at line 1930 of file nonclient.c.

1931 {
1932  RECT rcWindow, rcClient;
1933  DWORD Style, ExStyle;
1934 
1935  if (!pWnd) return HTNOWHERE;
1936 
1937  if (UserIsDesktopWindow(pWnd))
1938  {
1939  rcClient.left = rcClient.top = rcWindow.left = rcWindow.top = 0;
1944  }
1945  else
1946  {
1947  rcClient = pWnd->rcClient;
1948  rcWindow = pWnd->rcWindow;
1949  }
1950 
1951  if (!RECTL_bPointInRect(&rcWindow, pt.x, pt.y)) return HTNOWHERE;
1952 
1953  Style = pWnd->style;
1954  ExStyle = pWnd->ExStyle;
1955 
1956  if (Style & WS_MINIMIZE) return HTCAPTION;
1957 
1958  if (RECTL_bPointInRect( &rcClient, pt.x, pt.y )) return HTCLIENT;
1959 
1960  /* Check borders */
1961  if (HAS_THICKFRAME( Style, ExStyle ))
1962  {
1964  if (!RECTL_bPointInRect(&rcWindow, pt.x, pt.y ))
1965  {
1966  /* Check top sizing border */
1967  if (pt.y < rcWindow.top)
1968  {
1969  if (pt.x < rcWindow.left+UserGetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT;
1970  if (pt.x >= rcWindow.right-UserGetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT;
1971  return HTTOP;
1972  }
1973  /* Check bottom sizing border */
1974  if (pt.y >= rcWindow.bottom)
1975  {
1976  if (pt.x < rcWindow.left+UserGetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT;
1977  if (pt.x >= rcWindow.right-UserGetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT;
1978  return HTBOTTOM;
1979  }
1980  /* Check left sizing border */
1981  if (pt.x < rcWindow.left)
1982  {
1983  if (pt.y < rcWindow.top+UserGetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT;
1984  if (pt.y >= rcWindow.bottom-UserGetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT;
1985  return HTLEFT;
1986  }
1987  /* Check right sizing border */
1988  if (pt.x >= rcWindow.right)
1989  {
1990  if (pt.y < rcWindow.top+UserGetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT;
1991  if (pt.y >= rcWindow.bottom-UserGetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT;
1992  return HTRIGHT;
1993  }
1994  }
1995  }
1996  else /* No thick frame */
1997  {
1998  if (HAS_DLGFRAME( Style, ExStyle ))
2000  else if (HAS_THINFRAME( Style, ExStyle ))
2002  else if (HAS_CLIENTFRAME( Style, ExStyle ))
2004  if (!RECTL_bPointInRect( &rcWindow, pt.x, pt.y )) return HTBORDER;
2005  }
2006 
2007  /* Check caption */
2008 
2009  if ((Style & WS_CAPTION) == WS_CAPTION)
2010  {
2011  if (ExStyle & WS_EX_TOOLWINDOW)
2012  rcWindow.top += UserGetSystemMetrics(SM_CYSMCAPTION) - 1;
2013  else
2014  rcWindow.top += UserGetSystemMetrics(SM_CYCAPTION) - 1;
2015  if (!RECTL_bPointInRect( &rcWindow, pt.x, pt.y ))
2016  {
2017  BOOL min_or_max_box = (Style & WS_SYSMENU) && (Style & (WS_MINIMIZEBOX|WS_MAXIMIZEBOX));
2018  if (ExStyle & WS_EX_LAYOUTRTL)
2019  {
2020  /* Check system menu */
2021  if ((Style & WS_SYSMENU) && !(ExStyle & WS_EX_TOOLWINDOW) && NC_IconForWindow(pWnd))
2022  {
2023  rcWindow.right -= UserGetSystemMetrics(SM_CYCAPTION) - 1;
2024  if (pt.x > rcWindow.right) return HTSYSMENU;
2025  }
2026 
2027  /* Check close button */
2028  if (Style & WS_SYSMENU)
2029  {
2030  rcWindow.left += UserGetSystemMetrics(SM_CYCAPTION);
2031  if (pt.x < rcWindow.left) return HTCLOSE;
2032  }
2033 
2034  /* Check maximize box */
2035  /* In Win95 there is automatically a Maximize button when there is a minimize one */
2036  if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
2037  {
2038  rcWindow.left += UserGetSystemMetrics(SM_CXSIZE);
2039  if (pt.x < rcWindow.left) return HTMAXBUTTON;
2040  }
2041 
2042  /* Check minimize box */
2043  if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
2044  {
2045  rcWindow.left += UserGetSystemMetrics(SM_CXSIZE);
2046  if (pt.x < rcWindow.left) return HTMINBUTTON;
2047  }
2048  }
2049  else
2050  {
2051  /* Check system menu */
2052  if ((Style & WS_SYSMENU) && !(ExStyle & WS_EX_TOOLWINDOW) && NC_IconForWindow(pWnd))
2053  {
2054  rcWindow.left += UserGetSystemMetrics(SM_CYCAPTION) - 1;
2055  if (pt.x < rcWindow.left) return HTSYSMENU;
2056  }
2057 
2058  /* Check close button */
2059  if (Style & WS_SYSMENU)
2060  {
2062  if (pt.x > rcWindow.right) return HTCLOSE;
2063  }
2064 
2065  /* Check maximize box */
2066  /* In Win95 there is automatically a Maximize button when there is a minimize one */
2067  if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
2068  {
2069  rcWindow.right -= UserGetSystemMetrics(SM_CXSIZE);
2070  if (pt.x > rcWindow.right) return HTMAXBUTTON;
2071  }
2072 
2073  /* Check minimize box */
2074  if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
2075  {
2076  rcWindow.right -= UserGetSystemMetrics(SM_CXSIZE);
2077  if (pt.x > rcWindow.right) return HTMINBUTTON;
2078  }
2079  }
2080  return HTCAPTION;
2081  }
2082  }
2083 
2084  /* Check menu bar */
2085 
2086  if (HAS_MENU( pWnd, Style ) && (pt.y < rcClient.top) &&
2087  (pt.x >= rcClient.left) && (pt.x < rcClient.right))
2088  return HTMENU;
2089 
2090  /* Check vertical scroll bar */
2091 
2093  if (Style & WS_VSCROLL)
2094  {
2095  if((ExStyle & WS_EX_LEFTSCROLLBAR) != 0)
2096  rcClient.left -= UserGetSystemMetrics(SM_CXVSCROLL);
2097  else
2099  if (RECTL_bPointInRect( &rcClient, pt.x, pt.y )) return HTVSCROLL;
2100  }
2101 
2102  /* Check horizontal scroll bar */
2103 
2104  if (Style & WS_HSCROLL)
2105  {
2107  if (RECTL_bPointInRect( &rcClient, pt.x, pt.y ))
2108  {
2109  /* Check size box */
2110  if ((Style & WS_VSCROLL) &&
2111  ((((ExStyle & WS_EX_LEFTSCROLLBAR) != 0) && (pt.x <= rcClient.left + UserGetSystemMetrics(SM_CXVSCROLL))) ||
2112  (((ExStyle & WS_EX_LEFTSCROLLBAR) == 0) && (pt.x >= rcClient.right - UserGetSystemMetrics(SM_CXVSCROLL)))))
2113  return HTSIZE;
2114  return HTHSCROLL;
2115  }
2116  }
2117 
2118  /* Has to return HTNOWHERE if nothing was found
2119  Could happen when a window has a customized non client area */
2120  return HTNOWHERE;
2121 }
#define HTMAXBUTTON
Definition: winuser.h:2474
#define HTTOP
Definition: winuser.h:2480
#define HTLEFT
Definition: winuser.h:2477
#define HTHSCROLL
Definition: winuser.h:2471
#define SM_CYHSCROLL
Definition: winuser.h:956
#define SM_CYSIZE
Definition: winuser.h:986
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
VOID FASTCALL RECTL_vInflateRect(_Inout_ RECTL *rect, _In_ INT dx, _In_ INT dy)
Definition: rect.c:101
#define pt(x, y)
Definition: drawing.c:79
LONG top
Definition: windef.h:307
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
#define SM_CXEDGE
Definition: winuser.h:1002
#define HTBOTTOMLEFT
Definition: winuser.h:2484
#define HTRIGHT
Definition: winuser.h:2479
LONG left
Definition: windef.h:306
#define SM_CYFRAME
Definition: winuser.h:990
#define SM_CXFRAME
Definition: winuser.h:988
LONG right
Definition: windef.h:308
#define WS_EX_LEFTSCROLLBAR
Definition: winuser.h:392
#define HTNOWHERE
Definition: winuser.h:2464
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define HTMINBUTTON
Definition: winuser.h:2473
#define HTTOPLEFT
Definition: winuser.h:2481
#define HAS_CLIENTFRAME(Style, ExStyle)
Definition: window.h:19
#define SM_CXSCREEN
Definition: winuser.h:953
#define HTSYSMENU
Definition: winuser.h:2467
#define WS_MINIMIZE
Definition: pedump.c:622
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SM_CYDLGFRAME
Definition: winuser.h:962
#define HAS_THINFRAME(Style, ExStyle)
Definition: window.h:16
#define HAS_THICKFRAME(Style, ExStyle)
Definition: window.h:12
#define SM_CYEDGE
Definition: winuser.h:1003
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
PCURICON_OBJECT FASTCALL NC_IconForWindow(PWND pWnd)
Definition: nonclient.c:681
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
#define WS_CAPTION
Definition: pedump.c:624
#define HTSIZE
Definition: winuser.h:2469
#define SM_CYSCREEN
Definition: winuser.h:954
#define HTTOPRIGHT
Definition: winuser.h:2482
#define SM_CYCAPTION
Definition: winuser.h:957
const DWORD Style
Definition: appswitch.c:71
#define SM_CXDLGFRAME
Definition: winuser.h:960
#define HTBOTTOM
Definition: winuser.h:2483
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_HSCROLL
Definition: pedump.c:628
#define HTCLOSE
Definition: winuser.h:2489
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
Definition: rect.h:52
#define SM_CYBORDER
Definition: winuser.h:959
#define SM_CXBORDER
Definition: winuser.h:958
#define HTBOTTOMRIGHT
Definition: winuser.h:2485
#define HTCAPTION
Definition: winuser.h:2466
#define HAS_MENU(hwnd, style)
Definition: uxthemep.h:222
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define HTMENU
Definition: winuser.h:2470
#define HTBORDER
Definition: winuser.h:2487
#define WS_VSCROLL
Definition: pedump.c:627
#define SM_CXVSCROLL
Definition: winuser.h:955
#define HTVSCROLL
Definition: winuser.h:2472
#define SM_CXSIZE
Definition: winuser.h:985
#define HAS_DLGFRAME(Style, ExStyle)
Definition: window.h:8
LONG bottom
Definition: windef.h:309
#define HTCLIENT
Definition: winuser.h:2465
#define WS_SYSMENU
Definition: pedump.c:629
#define SM_CYSMCAPTION
Definition: winuser.h:1008
const DWORD ExStyle
Definition: appswitch.c:72

Referenced by DefWndStartSizeMove(), IntDefWindowProc(), MENU_PtMenu(), NC_DoButton(), and NC_HandleNCRButtonDown().

◆ IntBroadcastImeShowStatusChange()

BOOL FASTCALL IntBroadcastImeShowStatusChange ( PWND  pImeWnd,
BOOL  bShow 
)

Definition at line 2388 of file ime.c.

2389 {
2390  if (gfIMEShowStatus == bShow || !IS_IMM_MODE())
2391  return TRUE;
2392 
2393  gfIMEShowStatus = bShow;
2394  IntNotifyImeShowStatus(pImeWnd);
2395  return TRUE;
2396 }
VOID FASTCALL IntNotifyImeShowStatus(PWND pImeWnd)
Definition: ime.c:2331
#define TRUE
Definition: types.h:120
#define IS_IMM_MODE()
Definition: ntuser.h:1232
BOOL gfIMEShowStatus
Definition: ime.c:44

Referenced by NtUserCallHwndParamLock().

◆ IntBuildHwndList()

PWINDOWLIST FASTCALL IntBuildHwndList ( PWND  pwnd,
DWORD  dwFlags,
PTHREADINFO  pti 
)

Definition at line 1410 of file window.c.

1411 {
1412  PWINDOWLIST pwl;
1413  DWORD cbWL;
1414 
1415  if (gpwlCache)
1416  {
1417  pwl = gpwlCache;
1418  gpwlCache = NULL;
1419  }
1420  else
1421  {
1422 #define INITIAL_COUNT 32
1423  cbWL = sizeof(WINDOWLIST) + (INITIAL_COUNT - 1) * sizeof(HWND);
1425  if (!pwl)
1426  return NULL;
1427 
1428  pwl->phwndEnd = &pwl->ahwnd[INITIAL_COUNT];
1429 #undef INITIAL_COUNT
1430  }
1431 
1432  pwl->pti = pti;
1433  pwl->phwndLast = pwl->ahwnd;
1434  pwl = IntPopulateHwndList(pwl, pwnd, dwFlags);
1435  if (WL_IS_BAD(pwl))
1436  {
1438  return NULL;
1439  }
1440 
1441  *(pwl->phwndLast) = HWND_TERMINATOR;
1442 
1443  if (dwFlags & 0x8)
1444  {
1445  // TODO:
1446  }
1447 
1448  pwl->pti = GetW32ThreadInfo();
1449  pwl->pNextList = gpwlList;
1450  gpwlList = pwl;
1451 
1452  return pwl;
1453 }
#define HWND_TERMINATOR
Definition: window.h:82
struct tagWINDOWLIST * pNextList
Definition: window.h:86
HANDLE HWND
Definition: compat.h:19
struct tagWINDOWLIST WINDOWLIST
#define WL_IS_BAD(pwl)
Definition: window.h:96
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:801
HWND * phwndLast
Definition: window.h:87
#define INITIAL_COUNT
PWINDOWLIST gpwlCache
Definition: window.c:17
HWND ahwnd[ANYSIZE_ARRAY]
Definition: window.h:90
unsigned long DWORD
Definition: ntddk_ex.h:95
PWINDOWLIST FASTCALL IntPopulateHwndList(PWINDOWLIST pwl, PWND pwnd, DWORD dwFlags)
Definition: window.c:1380
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HWND * phwndEnd
Definition: window.h:88
PWINDOWLIST gpwlList
Definition: window.c:16
#define NULL
Definition: types.h:112
#define USERTAG_WINDOWLIST
Definition: tags.h:298
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
PTHREADINFO pti
Definition: window.h:89

Referenced by IntAssociateInputContextEx(), IntCheckImeShowStatus(), and IntDestroyInputContext().

◆ IntCheckImeShowStatusInThread()

VOID FASTCALL IntCheckImeShowStatusInThread ( PWND  pImeWnd)

Definition at line 2399 of file ime.c.

2400 {
2401  if (IS_IMM_MODE() && !(pImeWnd->state2 & WNDS2_INDESTROY))
2402  IntCheckImeShowStatus(pImeWnd, pImeWnd->head.pti);
2403 }
#define IS_IMM_MODE()
Definition: ntuser.h:1232
THRDESKHEAD head
Definition: ntuser.h:690
BOOL FASTCALL IntCheckImeShowStatus(PWND pwndIme, PTHREADINFO pti)
Definition: ime.c:2136
DWORD state2
Definition: ntuser.h:697
#define WNDS2_INDESTROY
Definition: ntuser.h:643

Referenced by NtUserCallHwndLock().

◆ IntCreateWindow()

PWND FASTCALL IntCreateWindow ( CREATESTRUCTW Cs,
PLARGE_STRING  WindowName,
PCLS  Class,
PWND  ParentWindow,
PWND  OwnerWindow,
PVOID  acbiBuffer,
PDESKTOP  pdeskCreated,
DWORD  dwVer 
)

Definition at line 1787 of file window.c.

1795 {
1796  PWND pWnd = NULL;
1797  HWND hWnd;
1798  PTHREADINFO pti;
1799  BOOL MenuChanged;
1800  BOOL bUnicodeWindow;
1801  PCALLPROCDATA pcpd;
1802 
1803  pti = pdeskCreated ? gptiDesktopThread : GetW32ThreadInfo();
1804 
1805  if (!(Cs->dwExStyle & WS_EX_LAYOUTRTL))
1806  { // Need both here for wine win.c test_CreateWindow.
1807  //if (Cs->hwndParent && ParentWindow)
1808  if (ParentWindow) // It breaks more tests..... WIP.
1809  {
1810  if ( (Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD &&
1811  ParentWindow->ExStyle & WS_EX_LAYOUTRTL &&
1812  !(ParentWindow->ExStyle & WS_EX_NOINHERITLAYOUT) )
1813  Cs->dwExStyle |= WS_EX_LAYOUTRTL;
1814  }
1815  else
1816  { /*
1817  * Note from MSDN <http://msdn.microsoft.com/en-us/library/aa913269.aspx>:
1818  *
1819  * Dialog boxes and message boxes do not inherit layout, so you must
1820  * set the layout explicitly.
1821  */
1822  if ( Class->fnid != FNID_DIALOG )
1823  {
1824  if (pti->ppi->dwLayout & LAYOUT_RTL)
1825  {
1826  Cs->dwExStyle |= WS_EX_LAYOUTRTL;
1827  }
1828  }
1829  }
1830  }
1831 
1832  /* Automatically add WS_EX_WINDOWEDGE */
1833  if ((Cs->dwExStyle & WS_EX_DLGMODALFRAME) ||
1834  ((!(Cs->dwExStyle & WS_EX_STATICEDGE)) &&
1835  (Cs->style & (WS_DLGFRAME | WS_THICKFRAME))))
1836  Cs->dwExStyle |= WS_EX_WINDOWEDGE;
1837  else
1838  Cs->dwExStyle &= ~WS_EX_WINDOWEDGE;
1839 
1840  /* Is it a unicode window? */
1841  bUnicodeWindow =!(Cs->dwExStyle & WS_EX_SETANSICREATOR);
1843 
1844  /* Allocate the new window */
1846  pdeskCreated ? pdeskCreated : pti->rpdesk,
1847  pti,
1848  (PHANDLE)&hWnd,
1849  TYPE_WINDOW,
1850  sizeof(WND) + Class->cbwndExtra);
1851 
1852  if (!pWnd)
1853  {
1854  goto AllocError;
1855  }
1856 
1857  TRACE("Created window object with handle %p\n", hWnd);
1858 
1859  if (pdeskCreated && pdeskCreated->DesktopWindow == NULL )
1860  { /* HACK: Helper for win32csr/desktopbg.c */
1861  /* If there is no desktop window yet, we must be creating it */
1862  TRACE("CreateWindow setting desktop.\n");
1863  pdeskCreated->DesktopWindow = hWnd;
1864  pdeskCreated->pDeskInfo->spwnd = pWnd;
1865  }
1866 
1867  /*
1868  * Fill out the structure describing it.
1869  */
1870  /* Remember, pWnd->head is setup in object.c ... */
1871  pWnd->spwndParent = ParentWindow;
1872  pWnd->spwndOwner = OwnerWindow;
1873  pWnd->fnid = 0;
1874  pWnd->spwndLastActive = pWnd;
1875  // Ramp up compatible version sets.
1876  if ( dwVer >= WINVER_WIN31 )
1877  {
1878  pWnd->state2 |= WNDS2_WIN31COMPAT;
1879  if ( dwVer >= WINVER_WINNT4 )
1880  {
1881  pWnd->state2 |= WNDS2_WIN40COMPAT;
1882  if ( dwVer >= WINVER_WIN2K )
1883  {
1884  pWnd->state2 |= WNDS2_WIN50COMPAT;
1885  }
1886  }
1887  }
1888  pWnd->pcls = Class;
1889  pWnd->hModule = Cs->hInstance;
1890  pWnd->style = Cs->style & ~WS_VISIBLE;
1891  pWnd->ExStyle = Cs->dwExStyle;
1892  pWnd->cbwndExtra = pWnd->pcls->cbwndExtra;
1893  pWnd->pActCtx = acbiBuffer;
1894 
1895  if (pti->spDefaultImc && Class->atomClassName != gpsi->atomSysClass[ICLS_BUTTON])
1896  pWnd->hImc = UserHMGetHandle(pti->spDefaultImc);
1897 
1898  pWnd->InternalPos.MaxPos.x = pWnd->InternalPos.MaxPos.y = -1;
1899  pWnd->InternalPos.IconPos.x = pWnd->InternalPos.IconPos.y = -1;
1900 
1901  if (pWnd->spwndParent != NULL && Cs->hwndParent != 0)
1902  {
1903  pWnd->HideFocus = pWnd->spwndParent->HideFocus;
1904  pWnd->HideAccel = pWnd->spwndParent->HideAccel;
1905  }
1906 
1907  pWnd->head.pti->cWindows++;
1908 
1909  if (Class->spicn && !Class->spicnSm)
1910  {
1911  HICON IconSmHandle = NULL;
1912  if((Class->spicn->CURSORF_flags & (CURSORF_LRSHARED | CURSORF_FROMRESOURCE))
1914  {
1915  IconSmHandle = co_IntCopyImage(
1916  UserHMGetHandle(Class->spicn),
1917  IMAGE_ICON,
1921  }
1922  if (!IconSmHandle)
1923  {
1924  /* Retry without copying from resource */
1925  IconSmHandle = co_IntCopyImage(
1926  UserHMGetHandle(Class->spicn),
1927  IMAGE_ICON,
1930  0);
1931  }
1932 
1933  if (IconSmHandle)
1934  {
1935  Class->spicnSm = UserGetCurIconObject(IconSmHandle);
1936  Class->CSF_flags |= CSF_CACHEDSMICON;
1937  }
1938  }
1939 
1940  if (pWnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
1942 
1943  /* BugBoy Comments: Comment below say that System classes are always created
1944  as UNICODE. In windows, creating a window with the ANSI version of CreateWindow
1945  sets the window to ansi as verified by testing with IsUnicodeWindow API.
1946 
1947  No where can I see in code or through testing does the window change back
1948  to ANSI after being created as UNICODE in ROS. I didnt do more testing to
1949  see what problems this would cause. */
1950 
1951  // Set WndProc from Class.
1952  if (IsCallProcHandle(pWnd->pcls->lpfnWndProc))
1953  {
1955  if (pcpd)
1956  pWnd->lpfnWndProc = pcpd->pfnClientPrevious;
1957  }
1958  else
1959  {
1960  pWnd->lpfnWndProc = pWnd->pcls->lpfnWndProc;
1961  }
1962 
1963  // GetWindowProc, test for non server side default classes and set WndProc.
1964  if ( pWnd->pcls->fnid <= FNID_GHOST && pWnd->pcls->fnid >= FNID_BUTTON )
1965  {
1966  if (bUnicodeWindow)
1967  {
1968  if (GETPFNCLIENTA(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
1969  pWnd->lpfnWndProc = GETPFNCLIENTW(pWnd->pcls->fnid);
1970  }
1971  else
1972  {
1973  if (GETPFNCLIENTW(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
1974  pWnd->lpfnWndProc = GETPFNCLIENTA(pWnd->pcls->fnid);
1975  }
1976  }
1977 
1978  // If not an Unicode caller, set Ansi creator bit.
1979  if (!bUnicodeWindow) pWnd->state |= WNDS_ANSICREATOR;
1980 
1981  // Clone Class Ansi/Unicode proc type.
1982  if (pWnd->pcls->CSF_flags & CSF_ANSIPROC)
1983  {
1984  pWnd->state |= WNDS_ANSIWINDOWPROC;
1985  pWnd->Unicode = FALSE;
1986  }
1987  else
1988  { /*
1989  * It seems there can be both an Ansi creator and Unicode Class Window
1990  * WndProc, unless the following overriding conditions occur:
1991  */
1992  if ( !bUnicodeWindow &&
1993  ( Class->atomClassName == gpsi->atomSysClass[ICLS_BUTTON] ||
1994  Class->atomClassName == gpsi->atomSysClass[ICLS_COMBOBOX] ||
1995  Class->atomClassName == gpsi->atomSysClass[ICLS_COMBOLBOX] ||
1996  Class->atomClassName == gpsi->atomSysClass[ICLS_DIALOG] ||
1997  Class->atomClassName == gpsi->atomSysClass[ICLS_EDIT] ||
1998  Class->atomClassName == gpsi->atomSysClass[ICLS_IME] ||
1999  Class->atomClassName == gpsi->atomSysClass[ICLS_LISTBOX] ||
2000  Class->atomClassName == gpsi->atomSysClass[ICLS_MDICLIENT] ||
2001  Class->atomClassName == gpsi->atomSysClass[ICLS_STATIC] ) )
2002  { // Override Class and set the window Ansi WndProc.
2003  pWnd->state |= WNDS_ANSIWINDOWPROC;
2004  pWnd->Unicode = FALSE;
2005  }
2006  else
2007  { // Set the window Unicode WndProc.
2008  pWnd->state &= ~WNDS_ANSIWINDOWPROC;
2009  pWnd->Unicode = TRUE;
2010  }
2011  }
2012 
2013  /* BugBoy Comments: if the window being created is a edit control, ATOM 0xCxxx,
2014  then my testing shows that windows (2k and XP) creates a CallProc for it immediately
2015  Dont understand why it does this. */
2016  if (Class->atomClassName == gpsi->atomSysClass[ICLS_EDIT])
2017  {
2018  PCALLPROCDATA CallProc;
2019  CallProc = CreateCallProc(pWnd->head.rpdesk, pWnd->lpfnWndProc, pWnd->Unicode , pWnd->head.pti->ppi);
2020 
2021  if (!CallProc)
2022  {
2024  ERR("Warning: Unable to create CallProc for edit control. Control may not operate correctly! hwnd %p\n", hWnd);
2025  }
2026  else
2027  {
2028  UserAddCallProcToClass(pWnd->pcls, CallProc);
2029  }
2030  }
2031 
2033  pWnd->PropListItems = 0;
2034 
2035  if ( WindowName->Buffer != NULL && WindowName->Length > 0 )
2036  {
2037  pWnd->strName.Buffer = DesktopHeapAlloc(pWnd->head.rpdesk,
2038  WindowName->Length + sizeof(UNICODE_NULL));
2039  if (pWnd->strName.Buffer == NULL)
2040  {
2041  goto AllocError;
2042  }
2043 
2044  RtlCopyMemory(pWnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
2045  pWnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
2046  pWnd->strName.Length = WindowName->Length;
2047  pWnd->strName.MaximumLength = WindowName->Length + sizeof(UNICODE_NULL);
2048  }
2049 
2050  /* Create the IME window for pWnd */
2051  if (IS_IMM_MODE() && !(pti->spwndDefaultIme) && IntWantImeWindow(pWnd))
2052  {
2053  PWND pwndDefaultIme = co_IntCreateDefaultImeWindow(pWnd, pWnd->hModule);
2054  UserAssignmentLock((PVOID*)&(pti->spwndDefaultIme), pwndDefaultIme);
2055 
2056  if (pwndDefaultIme)
2057  {
2058  HWND hImeWnd;
2060  UserRefObjectCo(pwndDefaultIme, &Ref);
2061 
2062  hImeWnd = UserHMGetHandle(pwndDefaultIme);
2063 
2065 
2066  if (pti->pClientInfo->CI_flags & CI_IMMACTIVATE)
2067  {
2068  HKL hKL = pti->KeyboardLayout->hkl;
2070  pti->pClientInfo->CI_flags &= ~CI_IMMACTIVATE;
2071  }
2072 
2073  UserDerefObjectCo(pwndDefaultIme);
2074  }
2075  }
2076 
2077  /* Correct the window style. */
2078  if ((pWnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
2079  {
2080  pWnd->style |= WS_CLIPSIBLINGS;
2081  if (!(pWnd->style & WS_POPUP))
2082  {
2083  pWnd->style |= WS_CAPTION;
2084  }
2085  }
2086 
2087  /* WS_EX_WINDOWEDGE depends on some other styles */
2088  if (pWnd->ExStyle & WS_EX_DLGMODALFRAME)
2089  pWnd->ExStyle |= WS_EX_WINDOWEDGE;
2090  else if (pWnd->style & (WS_DLGFRAME | WS_THICKFRAME))
2091  {
2092  if (!((pWnd->ExStyle & WS_EX_STATICEDGE) &&
2093  (pWnd->style & (WS_CHILD | WS_POPUP))))
2094  pWnd->ExStyle |= WS_EX_WINDOWEDGE;
2095  }
2096  else
2097  pWnd->ExStyle &= ~WS_EX_WINDOWEDGE;
2098 
2099  if (!(pWnd->style & (WS_CHILD | WS_POPUP)))
2100  pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
2101 
2102  /* Set the window menu */
2103  if ((Cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
2104  {
2105  if (Cs->hMenu)
2106  {
2107  IntSetMenu(pWnd, Cs->hMenu, &MenuChanged);
2108  }
2109  else if (pWnd->pcls->lpszMenuName) // Take it from the parent.
2110  {
2111  UNICODE_STRING MenuName;
2112  HMENU hMenu;
2113 
2114  if (IS_INTRESOURCE(pWnd->pcls->lpszMenuName))
2115  {
2116  MenuName.Length = 0;
2117  MenuName.MaximumLength = 0;
2118  MenuName.Buffer = pWnd->pcls->lpszMenuName;
2119  }
2120  else
2121  {
2122  RtlInitUnicodeString( &MenuName, pWnd->pcls->lpszMenuName);
2123  }
2124  hMenu = co_IntCallLoadMenu( pWnd->pcls->hModule, &MenuName);
2125  if (hMenu) IntSetMenu(pWnd, hMenu, &MenuChanged);
2126  }
2127  }
2128  else // Not a child
2129  pWnd->IDMenu = (UINT_PTR)Cs->hMenu;
2130 
2131 
2132  if ( ParentWindow &&
2133  ParentWindow != ParentWindow->head.rpdesk->spwndMessage &&
2134  ParentWindow != ParentWindow->head.rpdesk->pDeskInfo->spwnd )
2135  {
2136  PWND Owner = IntGetNonChildAncestor(ParentWindow);
2137 
2138  if (!IntValidateOwnerDepth(pWnd, Owner))
2139  {
2141  goto Error;
2142  }
2143  if ( pWnd->spwndOwner &&
2144  pWnd->spwndOwner->ExStyle & WS_EX_TOPMOST )
2145  {
2146  pWnd->ExStyle |= WS_EX_TOPMOST;
2147  }
2148  if ( pWnd->spwndOwner &&
2149  Class->atomClassName != gpsi->atomSysClass[ICLS_IME] &&
2150  pti != pWnd->spwndOwner->head.pti)
2151  {
2152  //ERR("CreateWindow Owner in.\n");
2153  UserAttachThreadInput(pti, pWnd->spwndOwner->head.pti, TRUE);
2154  }
2155  }
2156 
2157  /* Insert the window into the thread's window list. */
2159 
2160  /* Handle "CS_CLASSDC", it is tested first. */
2161  if ( (pWnd->pcls->style & CS_CLASSDC) && !(pWnd->pcls->pdce) )
2162  { /* One DCE per class to have CLASS. */
2163  pWnd->pcls->pdce = DceAllocDCE( pWnd, DCE_CLASS_DC );
2164  }
2165  else if ( pWnd->pcls->style & CS_OWNDC)
2166  { /* Allocate a DCE for this window. */
2167  DceAllocDCE(pWnd, DCE_WINDOW_DC);
2168  }
2169 
2170  return pWnd;
2171 
2172 AllocError:
2173  ERR("IntCreateWindow Allocation Error.\n");
2175 Error:
2176  if(pWnd)
2177  UserDereferenceObject(pWnd);
2178  return NULL;
2179 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static const WCHAR Class[]
Definition: cfgmgr.c:42
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
#define WS_THICKFRAME
Definition: pedump.c:630
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
DWORD ExStyle
Definition: ntuser.h:699
static HICON
Definition: imagelist.c:84
UINT HideFocus
Definition: ntuser.h:753
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IMAGE_ICON
Definition: winuser.h:212
#define ICLS_MDICLIENT
Definition: ntuser.h:913
LIST_ENTRY ThreadListEntry
Definition: ntuser.h:759
WNDPROC pfnClientPrevious
Definition: ntuser.h:547
struct _DESKTOP * rpdesk
Definition: ntuser.h:194
struct tagIMC * spDefaultImc
Definition: win32.h:132
#define LAYOUT_RTL
Definition: wingdi.h:1371
ULONG PropListItems
Definition: ntuser.h:719
NTSTATUS FASTCALL UserAttachThreadInput(PTHREADINFO ptiFrom, PTHREADINFO ptiTo, BOOL fAttach)
Definition: input.c:480
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
Definition: cursoricon.c:200
USHORT MaximumLength
Definition: env_spec_w32.h:370
PVOID FASTCALL UserAssignmentLock(PVOID *ppvObj, PVOID pvNew)
Definition: object.c:840
PVOID Buffer
Definition: ntuser.h:94
#define GETPFNCLIENTW(fnid)
Definition: ntuser.h:901
#define TRUE
Definition: types.h:120
#define CURSORF_FROMRESOURCE
Definition: ntuser.h:1194
LIST_ENTRY WindowListHead
Definition: win32.h:155
HINSTANCE hModule
Definition: ntuser.h:703
#define IS_IMM_MODE()
Definition: ntuser.h:1232
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
WNDPROC lpfnWndProc
Definition: ntuser.h:713
BOOL FASTCALL IntValidateOwnerDepth(PWND Wnd, PWND Owner)
Definition: window.c:362
HINSTANCE hModule
Definition: ntuser.h:579
#define WINVER_WIN2K
Definition: window.h:55
#define ICLS_EDIT
Definition: ntuser.h:908
PSERVERINFO gpsi
Definition: imm.c:18
LIST_ENTRY PropListHead
Definition: ntuser.h:718
HWND hWnd
Definition: settings.c:17
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
struct _WND WND
#define WS_DLGFRAME
Definition: pedump.c:626
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define SM_CYSMICON
Definition: winuser.h:1007
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
#define WNDS_SENDSIZEMOVEMSGS
Definition: ntuser.h:604
#define WS_CHILD
Definition: pedump.c:617
#define CS_OWNDC
Definition: winuser.h:650
HIMC hImc
Definition: ntuser.h:735
#define InsertTailList(ListHead, Entry)
if(dx==0 &&dy==0)
Definition: linetemp.h:174
struct _DESKTOP * rpdesk
Definition: win32.h:92
#define WINVER_WINNT4
Definition: window.h:56
#define ICLS_DIALOG
Definition: ntuser.h:925
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
Definition: object.c:568
PWND FASTCALL co_IntCreateDefaultImeWindow(PWND pwndTarget, HINSTANCE hInst)
Definition: ime.c:1964
DWORD dwLayout
Definition: win32.h:279
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:801
PPROCESSINFO ppi
Definition: win32.h:88
PCALLPROCDATA CreateCallProc(IN PDESKTOP Desktop, IN WNDPROC WndProc, IN BOOL Unicode, IN PPROCESSINFO pi)
Definition: callproc.c:29
WNDPROC lpfnWndProc
Definition: ntuser.h:576
PTHREADINFO gptiDesktopThread
Definition: desktop.c:37
ULONG cbwndExtra
Definition: ntuser.h:733
#define ICLS_LISTBOX
Definition: ntuser.h:910
DWORD CSF_flags
Definition: ntuser.h:568
#define CSF_CACHEDSMICON
Definition: ntuser.h:557
#define L(x)
Definition: ntvdm.h:50
UINT style
Definition: ntuser.h:575
static __inline PVOID DesktopHeapAlloc(IN PDESKTOP Desktop, IN SIZE_T Bytes)
Definition: desktop.h:204
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
DWORD fnid
Definition: ntuser.h:704
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CURSORF_LRSHARED
Definition: ntuser.h:1196
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
HMENU APIENTRY co_IntCallLoadMenu(HINSTANCE hModule, PUNICODE_STRING pMenuName)
Definition: callback.c:903
#define FNID_DIALOG
Definition: ntuser.h:864
struct _WND * spwndOwner
Definition: ntuser.h:710
THRDESKHEAD head
Definition: ntuser.h:690
Definition: object.h:3
BOOL FASTCALL IntWantImeWindow(PWND pwndTarget)
Definition: ime.c:1924
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
LONG_PTR LPARAM
Definition: windef.h:208
struct _WND * spwndDefaultIme
Definition: win32.h:131
PVOID pdce
Definition: ntuser.h:567
#define WM_IME_SYSTEM
Definition: undocuser.h:60
LARGE_UNICODE_STRING strName
Definition: ntuser.h:731
#define ICLS_STATIC
Definition: ntuser.h:909
UINT HideAccel
Definition: ntuser.h:754
HANDLE FASTCALL co_IntCopyImage(HANDLE hnd, UINT type, INT desiredx, INT desiredy, UINT flags)
Definition: callback.c:985
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
HINSTANCE hInstance
Definition: winuser.h:2946
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define WS_CAPTION
Definition: pedump.c:624
UINT_PTR IDMenu
Definition: ntuser.h:726
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define IMS_LOADTHREADLAYOUT
Definition: immdev.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG Length
Definition: ntuser.h:91
DWORD fnid
Definition: ntuser.h:565
#define WS_EX_NOINHERITLAYOUT
Definition: winuser.h:396
BOOL Error
Definition: chkdsk.c:66
struct _CLIENTINFO * pClientInfo
Definition: win32.h:94
#define SM_CXSMICON
Definition: winuser.h:1006
#define IMS_ACTIVATELAYOUT
Definition: immdev.h:40
#define CSF_SERVERSIDEPROC
Definition: ntuser.h:551
#define WNDS2_WIN50COMPAT
Definition: ntuser.h:646
#define ICLS_IME
Definition: ntuser.h:922
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
struct _WND::@4897 InternalPos
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
#define GETPFNCLIENTA(fnid)
Definition: ntuser.h:899
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define CSF_ANSIPROC
Definition: ntuser.h:552
UINT_PTR HKL
Definition: msctf.idl:101
#define ICLS_COMBOLBOX
Definition: ntuser.h:914
struct tagKL * KeyboardLayout
Definition: win32.h:90
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
INT cbwndExtra
Definition: ntuser.h:578
VOID UserAddCallProcToClass(IN OUT PCLS Class, IN PCALLPROCDATA CallProc)
Definition: class.c:423
PWSTR lpszMenuName
Definition: ntuser.h:583
#define CS_CLASSDC
Definition: winuser.h:645
#define WS_EX_SETANSICREATOR
Definition: undocuser.h:28
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
#define FNID_GHOST
Definition: ntuser.h:870
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1093
struct _WND * PWND
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495
struct _WND * spwndLastActive
Definition: ntuser.h:734
#define CI_IMMACTIVATE
Definition: ntuser.h:305
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define WNDS_ANSIWINDOWPROC
Definition: ntuser.h:619
#define FNID_BUTTON
Definition: ntuser.h:861
DWORD state
Definition: ntuser.h:696
#define WNDS2_WIN31COMPAT
Definition: ntuser.h:644
#define WS_POPUP
Definition: pedump.c:616
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1597
#define NULL
Definition: types.h:112
#define WINVER_WIN31
Definition: window.h:57
PWND FASTCALL IntGetNonChildAncestor(PWND pWnd)
Definition: window.c:346
struct _WND * spwndParent
Definition: ntuser.h:708
DWORD state2
Definition: ntuser.h:697
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ICLS_BUTTON
Definition: ntuser.h:907
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
PVOID pActCtx
Definition: ntuser.h:737
#define WNDS2_WIN40COMPAT
Definition: ntuser.h:645
PDCE FASTCALL DceAllocDCE(PWND Window, DCE_TYPE Type)
Definition: windc.c:86
#define WS_VISIBLE
Definition: pedump.c:620
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
#define WNDS_ANSICREATOR
Definition: ntuser.h:629
BOOL FASTCALL IntSetMenu(PWND Wnd, HMENU Menu, BOOL *Changed)
Definition: menu.c:5459
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:618
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WS_EX_STATICEDGE
Definition: winuser.h:403
UINT Unicode
Definition: ntuser.h:751
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1055
PCLS pcls
Definition: ntuser.h:715
DWORD style
Definition: ntuser.h:701
#define ICLS_COMBOBOX
Definition: ntuser.h:912

Referenced by co_UserCreateWindowEx(), and IntCreateDesktop().

◆ IntDefWindowProc()

LRESULT FASTCALL IntDefWindowProc ( PWND  Window,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  Ansi 
)

Definition at line 537 of file defwnd.c.

543 {
545  LRESULT lResult = 0;
547  BOOL IsTaskBar;
548  DWORD Style;
549  DWORD ExStyle;
550 
551  if (Msg > WM_USER) return 0;
552 
553  switch (Msg)
554  {
555  case WM_DEVICECHANGE:
556  return TRUE;
557 
558  case WM_GETTEXTLENGTH:
559  {
560  PWSTR buf;
561  ULONG len;
562 
563  if (Wnd != NULL && Wnd->strName.Length != 0)
564  {
565  buf = Wnd->strName.Buffer;
566  if (buf != NULL &&
568  buf,
569  Wnd->strName.Length)))
570  {
571  lResult = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
572  }
573  }
574  else lResult = 0L;
575 
576  break;
577  }
578 
579  case WM_GETTEXT: // FIXME: Handle Ansi
580  {
581  PWSTR buf = NULL;
582  PWSTR outbuf = (PWSTR)lParam;
583 
584  if (Wnd != NULL && wParam != 0)
585  {
586  if (Wnd->strName.Buffer != NULL)
587  buf = Wnd->strName.Buffer;
588  else
589  outbuf[0] = L'\0';
590 
591  if (buf != NULL)
592  {
593  if (Wnd->strName.Length != 0)
594  {
595  lResult = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
596  RtlCopyMemory(outbuf,
597  buf,
598  lResult * sizeof(WCHAR));
599  outbuf[lResult] = L'\0';
600  }
601  else
602  outbuf[0] = L'\0';
603  }
604  }
605  break;
606  }
607 
608  case WM_SETTEXT: // FIXME: Handle Ansi
609  {
610  DefSetText(Wnd, (PCWSTR)lParam);
611 
612  if ((Wnd->style & WS_CAPTION) == WS_CAPTION)
614  IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, Wnd, OBJID_WINDOW, CHILDID_SELF, 0);
615  lResult = 1;
616  break;
617  }
618 
619  case WM_SYSCOMMAND:
620  {
621  TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam );
622  lResult = DefWndHandleSysCommand(Wnd, wParam, lParam);
623  break;
624  }
625 
626  case WM_SHOWWINDOW:
627  {
628  if ((Wnd->style & WS_VISIBLE) && wParam) break;
629  if (!(Wnd->style & WS_VISIBLE) && !wParam) break;
630  if (!Wnd->spwndOwner) break;
631  if (LOWORD(lParam))
632  {
634  }
635  break;
636  }
637 
638  case WM_CLIENTSHUTDOWN:
639  return IntClientShutdown(Wnd, wParam, lParam);
640 
641  case WM_APPCOMMAND:
642  if ( (Wnd->style & (WS_POPUP|WS_CHILD)) != WS_CHILD &&
643  Wnd != co_GetDesktopWindow(Wnd) )
644  {
645  if (!co_HOOK_CallHooks(WH_SHELL, HSHELL_APPCOMMAND, wParam, lParam))
646  co_IntShellHookNotify(HSHELL_APPCOMMAND, wParam, lParam);
647  break;
648  }
649  UserRefObjectCo(Wnd->spwndParent, &Ref);
650  lResult = co_IntSendMessage(UserHMGetHandle(Wnd->spwndParent), WM_APPCOMMAND, wParam, lParam);
651  UserDerefObjectCo(Wnd->spwndParent);
652  break;
653 
654  case WM_KEYF1:
655  {
656  HELPINFO hi;
657  HMENU hMenu = UlongToHandle(Wnd->IDMenu);
658  PWND pwndActive = MENU_IsMenuActive();
659  hi.cbSize = sizeof(HELPINFO);
660  hi.MousePos = gpsi->ptCursor;
662  hi.hItemHandle = pwndActive ? UserHMGetHandle(pwndActive) : UserHMGetHandle(Wnd);
663  hi.iCtrlId = (Wnd->style & (WS_POPUP|WS_CHILD)) == WS_CHILD ? IntMenuItemFromPoint(Wnd, hMenu, hi.MousePos) : 0;
665 
666  co_IntSendMessage( UserHMGetHandle(Wnd), WM_HELP, 0, (LPARAM)&hi );
667  break;
668  }
669 
670  case WM_SETICON:
671  {
672  return DefWndSetIcon(Wnd, wParam, lParam);
673  }
674 
675  case WM_GETICON:
676  {
677  return DefWndGetIcon(Wnd, wParam, lParam);
678  }
679 
680  case WM_HELP:
681  {
682  PWND Parent = IntGetParent(Wnd);
684  break;
685  }
686 
687  case WM_LBUTTONDOWN:
688  case WM_RBUTTONDOWN:
689  case WM_MBUTTONDOWN:
690  pti->MessageQueue->QF_flags &= ~(QF_FMENUSTATUS|QF_FMENUSTATUSBREAK);
691  break;
692 
693  case WM_NCLBUTTONDOWN:
694  return NC_HandleNCLButtonDown(Wnd, wParam, lParam);
695 
696  case WM_NCRBUTTONDOWN:
697  return NC_HandleNCRButtonDown(Wnd, wParam, lParam);
698 
699  case WM_LBUTTONDBLCLK:
701 
702  case WM_NCLBUTTONDBLCLK:
703  return NC_HandleNCLButtonDblClk(Wnd, wParam, lParam);
704 
705  case WM_RBUTTONUP:
706  {
707  POINT Pt;
708 
709  Pt.x = GET_X_LPARAM(lParam);
710  Pt.y = GET_Y_LPARAM(lParam);
711  IntClientToScreen(Wnd, &Pt);
712  lParam = MAKELPARAM(Pt.x, Pt.y);
714  break;
715  }
716 
717  case WM_NCRBUTTONUP:
718  /*
719  * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked
720  * in Windows), but what _should_ we do? According to MSDN :
721  * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND
722  * message to the window". When is it appropriate?
723  */
724  ERR("WM_NCRBUTTONUP\n");
725  break;
726 
727  case WM_XBUTTONUP:
728  case WM_NCXBUTTONUP:
729  if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
730  {
732  MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
733  }
734  break;
735 
736 
737  case WM_CONTEXTMENU:
738  {
739  if (Wnd->style & WS_CHILD)
740  {
742  }
743  else
744  {
745  POINT Pt;
746  LONG_PTR Style;
747  LONG HitCode;
748 
749  Style = Wnd->style;
750 
751  Pt.x = GET_X_LPARAM(lParam);
752  Pt.y = GET_Y_LPARAM(lParam);
753  if (Style & WS_CHILD)
754  {
755  IntScreenToClient(IntGetParent(Wnd), &Pt);
756  }
757 
758  HitCode = GetNCHitEx(Wnd, Pt);
759 
760  if (HitCode == HTCAPTION || HitCode == HTSYSMENU)
761  {
762  PMENU SystemMenu;
763  UINT Flags;
764 
765  if((SystemMenu = IntGetSystemMenu(Wnd, FALSE)))
766  {
767  MENU_InitSysMenuPopup(SystemMenu, Wnd->style, Wnd->pcls->style, HitCode);
768 
769  if(HitCode == HTCAPTION)
771  else
773 
774  IntTrackPopupMenuEx(SystemMenu, Flags|TPM_SYSTEM_MENU, Pt.x, Pt.y, Wnd, NULL);
775  }
776  }
777  if (HitCode == HTHSCROLL || HitCode == HTVSCROLL)
778  {
779  WARN("Scroll Menu Not Supported\n");
780  }
781  }
782  break;
783  }
784 
785  case WM_KEYDOWN:
786  if (wParam == VK_F10)
787  {
788  pti->MessageQueue->QF_flags |= QF_FF10STATUS;
789 
790  if (UserGetKeyState(VK_SHIFT) & 0x8000)
791  {
793  }
794  }
796  {
797  HWND hwndTop = UserGetForegroundWindow();
798  PWND topWnd = UserGetWindowObject(hwndTop);
799 
800  /* Test for typical TaskBar ExStyle Values */
801  ExStyle = (topWnd->ExStyle & WS_EX_TOOLWINDOW);
802  TRACE("ExStyle is '%x'.\n", ExStyle);
803 
804  /* Test for typical TaskBar Style Values */
805  Style = (topWnd->style & (WS_POPUP | WS_VISIBLE |
807  TRACE("Style is '%x'.\n", Style);
808 
809  /* Test for masked typical TaskBar Style and ExStyles to detect TaskBar */
810  IsTaskBar = (Style == (WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN))
811  && (ExStyle == WS_EX_TOOLWINDOW);
812  TRACE("This %s the TaskBar.\n", IsTaskBar ? "is" : "is not");
813 
814  if (topWnd && !IsTaskBar) /* Second test is so we are not touching the Taskbar */
815  {
816  if ((topWnd->style & WS_THICKFRAME) == 0)
817  {
818  return 0;
819  }
820 
821  if (wParam == VK_DOWN)
822  {
823  if (topWnd->style & WS_MAXIMIZE)
824  {
826 
827  /* "Normal size" must be erased after restoring, otherwise it will block next side snap actions */
828  RECTL_vSetEmptyRect(&topWnd->InternalPos.NormalRect);
829  }
830  else
831  {
833  }
834  }
835  else if (wParam == VK_UP)
836  {
837  RECT currentRect;
838  if ((topWnd->InternalPos.NormalRect.right == topWnd->InternalPos.NormalRect.left) ||
839  (topWnd->InternalPos.NormalRect.top == topWnd->InternalPos.NormalRect.bottom))
840  {
841  currentRect = topWnd->rcWindow;
842  }
843  else
844  {
845  currentRect = topWnd->InternalPos.NormalRect;
846  }
848 
849  // save normal rect if maximazing snapped window
850  topWnd->InternalPos.NormalRect = currentRect;
851  }
852  else if (wParam == VK_LEFT || wParam == VK_RIGHT)
853  {
854  RECT snapRect, normalRect, windowRect;
855  BOOL snapped;
856  normalRect = topWnd->InternalPos.NormalRect;
857  snapped = (normalRect.left != 0 && normalRect.right != 0 &&
858  normalRect.top != 0 && normalRect.bottom != 0);
859 
860  if (topWnd->style & WS_MAXIMIZE)
861  {
863  snapped = FALSE;
864  }
865  windowRect = topWnd->rcWindow;
866 
867  UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0);
868  if (wParam == VK_LEFT)
869  {
870  snapRect.right = (snapRect.left + snapRect.right) / 2;
871  }
872  else // VK_RIGHT
873  {
874  snapRect.left = (snapRect.left + snapRect.right) / 2;
875  }
876 
877  if (snapped)
878  {
879  // if window was snapped but moved to other location - restore normal size
880  if (!IntEqualRect(&snapRect, &windowRect))
881  {
882  RECT empty = {0, 0, 0, 0};
883  co_WinPosSetWindowPos(topWnd,
884  0,
885  normalRect.left,
886  normalRect.top,
887  normalRect.right - normalRect.left,
888  normalRect.bottom - normalRect.top,
889  0);
890  topWnd->InternalPos.NormalRect = empty;
891  }
892  }
893  else
894  {
895  co_WinPosSetWindowPos(topWnd,
896  0,
897  snapRect.left,
898  snapRect.top,
899  snapRect.right - snapRect.left,
900  snapRect.bottom - snapRect.top,
901  0);
902  topWnd->InternalPos.NormalRect = windowRect;
903  }
904  }
905  }
906  }
907  break;
908 
909  case WM_SYSKEYDOWN:
910  {
911  if (HIWORD(lParam) & KF_ALTDOWN)
912  { /* Previous state, if the key was down before this message,
913  this is a cheap way to ignore autorepeat keys. */
914  if ( !(HIWORD(lParam) & KF_REPEAT) )
915  {
916  if ( ( wParam == VK_MENU ||
917  wParam == VK_LMENU ||
918  wParam == VK_RMENU ) && !(pti->MessageQueue->QF_flags & QF_FMENUSTATUS)) //iMenuSysKey )
919  pti->MessageQueue->QF_flags |= QF_FMENUSTATUS; //iMenuSysKey = 1;
920  else
921  pti->MessageQueue->QF_flags &= ~QF_FMENUSTATUS; //iMenuSysKey = 0;
922  }
923 
924  pti->MessageQueue->QF_flags &= ~QF_FF10STATUS; //iF10Key = 0;
925 
926  if (wParam == VK_F4) /* Try to close the window */
927  {
929  if (!(top->style & CS_NOCLOSE))
931  }
932  else if (wParam == VK_SNAPSHOT) // Alt-VK_SNAPSHOT?
933  {
934  PWND pwnd = Wnd;
935  while (IntGetParent(pwnd) != NULL)
936  {
937  pwnd = IntGetParent(pwnd);
938  }
939  ERR("DefWndScreenshot\n");
940  DefWndScreenshot(pwnd);
941  }
942  else if ( wParam == VK_ESCAPE || wParam == VK_TAB ) // Alt-Tab/ESC Alt-Shift-Tab/ESC
943  {
944  WPARAM wParamTmp;
945  HWND Active = UserGetActiveWindow(); // Noticed MDI problem.
946  if (!Active)
947  {
948  FIXME("WM_SYSKEYDOWN VK_ESCAPE no active\n");
949  break;
950  }
951  wParamTmp = UserGetKeyState(VK_SHIFT) & 0x8000 ? SC_PREVWINDOW : SC_NEXTWINDOW;
953  }
954  else if (wParam == VK_SHIFT) // Alt+Shift
955  {
956  RTL_ATOM ClassAtom = 0;
957  UNICODE_STRING ustrClass, ustrWindow;
958  HWND hwndSwitch;
959 
960  RtlInitUnicodeString(&ustrClass, L"kbswitcher");
961  RtlInitUnicodeString(&ustrWindow, L"");
962 
963  IntGetAtomFromStringOrAtom(&ustrClass, &ClassAtom);
964 
965  hwndSwitch = IntFindWindow(UserGetDesktopWindow(), NULL, ClassAtom, &ustrWindow);
966  if (hwndSwitch)
967  {
968 #define ID_NEXTLAYOUT 10003
970  }
971  }
972  }
973  else if( wParam == VK_F10 )
974  {
975  if (UserGetKeyState(VK_SHIFT) & 0x8000)
977  pti->MessageQueue->QF_flags |= QF_FF10STATUS; //iF10Key = 1;
978  }
979  else if( wParam == VK_ESCAPE && (UserGetKeyState(VK_SHIFT) & 0x8000))
981  break;
982  }
983 
984  case WM_KEYUP:
985  case WM_SYSKEYUP:
986  {
987  /* Press and release F10 or ALT */
988  if (((wParam == VK_MENU || wParam == VK_LMENU || wParam == VK_RMENU)
989  && (pti->MessageQueue->QF_flags & (QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) == QF_FMENUSTATUS /*iMenuSysKey*/) ||
990  ((wParam == VK_F10) && pti->MessageQueue->QF_flags & QF_FF10STATUS /*iF10Key*/))
992  pti->MessageQueue->QF_flags &= ~(QF_FMENUSTATUS|QF_FMENUSTATUSBREAK|QF_FF10STATUS); //iMenuSysKey = iF10Key = 0;
993  break;
994  }
995 
996  case WM_SYSCHAR:
997  {
998  pti->MessageQueue->QF_flags &= ~(QF_FMENUSTATUS|QF_FMENUSTATUSBREAK); //iMenuSysKey = 0;
999  if (wParam == VK_RETURN && (Wnd->style & WS_MINIMIZE) != 0)
1000  {
1002  break;
1003  }
1004  if ((HIWORD(lParam) & KF_ALTDOWN) && wParam)
1005  {
1006  if (wParam == VK_TAB || wParam == VK_ESCAPE) break;
1007  if (wParam == VK_SPACE && Wnd->style & WS_CHILD)
1009  else
1011  }
1012  else /* check for Ctrl-Esc */
1013  if (wParam != VK_ESCAPE) UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_MESSAGE_BEEP, 0); //MessageBeep(0);
1014  break;
1015  }
1016 
1017  case WM_CANCELMODE:
1018  {
1019  pti->MessageQueue->QF_flags &= ~(QF_FMENUSTATUS|QF_FMENUSTATUSBREAK);
1020 
1021  MENU_EndMenu( Wnd );
1022  if (IntGetCaptureWindow() == UserHMGetHandle(Wnd))
1023  {
1025  }
1026  break;
1027  }
1028 
1029  case WM_CLOSE:
1030  co_UserDestroyWindow(Wnd);
1031  break;
1032 
1033  case WM_CTLCOLORMSGBOX:
1034  case WM_CTLCOLOREDIT:
1035  case WM_CTLCOLORLISTBOX:
1036  case WM_CTLCOLORBTN:
1037  case WM_CTLCOLORDLG:
1038  case WM_CTLCOLORSTATIC:
1039  case WM_CTLCOLORSCROLLBAR:
1041 
1042  case WM_CTLCOLOR:
1044 
1045  case WM_SETCURSOR:
1046  {
1047  if (Wnd->style & WS_CHILD)
1048  {
1049  /* with the exception of the border around a resizable wnd,
1050  * give the parent first chance to set the cursor */
1052  {
1053  PWND parent = Wnd->spwndParent;//IntGetParent( Wnd );
1054  if (parent != UserGetDesktopWindow() &&
1056  return TRUE;
1057  }
1058  }
1059  return DefWndHandleSetCursor(Wnd, wParam, lParam);
1060  }
1061 
1062  case WM_MOUSEACTIVATE:
1063  if (Wnd->style & WS_CHILD)
1064  {
1065  LONG Ret;
1066  HWND hwndParent;
1067  PWND pwndParent = IntGetParent(Wnd);
1068  hwndParent = pwndParent ? UserHMGetHandle(pwndParent) : NULL;
1070  if (Ret) return (Ret);
1071  }
1073 
1074  case WM_ACTIVATE:
1075  /* The default action in Windows is to set the keyboard focus to
1076  * the window, if it's being activated and not minimized */
1077  if (LOWORD(wParam) != WA_INACTIVE &&
1078  !(Wnd->style & WS_MINIMIZE))
1079  {
1080  //ERR("WM_ACTIVATE %p\n",hWnd);
1081  co_UserSetFocus(Wnd);
1082  }
1083  break;
1084 
1085  case WM_MOUSEWHEEL:
1086  if (Wnd->style & WS_CHILD)
1087  {
1088  HWND hwndParent;
1089  PWND pwndParent = IntGetParent(Wnd);
1090  hwndParent = pwndParent ? UserHMGetHandle(pwndParent) : NULL;
1092  }
1093  break;
1094 
1095  case WM_ERASEBKGND:
1096  case WM_ICONERASEBKGND:
1097  {
1098  RECT Rect;
1099  HBRUSH hBrush = Wnd->pcls->hbrBackground;
1100  if (!hBrush) return 0;
1101  if (hBrush <= (HBRUSH)COLOR_MENUBAR)
1102  {
1103  hBrush = IntGetSysColorBrush(HandleToUlong(hBrush));
1104  }
1105  if (Wnd->pcls->style & CS_PARENTDC)
1106  {
1107  /* can't use GetClipBox with a parent DC or we fill the whole parent */
1108  IntGetClientRect(Wnd, &Rect);
1109  GreDPtoLP((HDC)wParam, (LPPOINT)&Rect, 2);
1110  }
1111  else
1112  {
1113  GdiGetClipBox((HDC)wParam, &Rect);
1114  }
1115  FillRect((HDC)wParam, &Rect, hBrush);
1116  return (1);
1117  }
1118 
1119  case WM_GETHOTKEY:
1120  //ERR("WM_GETHOTKEY\n");
1121  return DefWndGetHotKey(Wnd);
1122  case WM_SETHOTKEY:
1123  //ERR("WM_SETHOTKEY\n");
1124  return DefWndSetHotKey(Wnd, wParam);
1125 
1126  case WM_NCHITTEST:
1127  {
1128  POINT Point;
1131  return GetNCHitEx(Wnd, Point);
1132  }
1133 
1134  case WM_PRINT:
1135  {
1136  DefWndPrint(Wnd, (HDC)wParam, lParam);
1137  return (0);
1138  }
1139 
1140  case WM_SYSCOLORCHANGE:
1141  {
1142  /* force to redraw non-client area */
1143  UserPaintCaption(Wnd, DC_NC);
1144  /* Use InvalidateRect to redraw client area, enable
1145  * erase to redraw all subcontrols otherwise send the
1146  * WM_SYSCOLORCHANGE to child windows/controls is required
1147  */
1149  return (0);
1150  }
1151 
1152  case WM_PAINTICON:
1153  case WM_PAINT:
1154  {
1155  PAINTSTRUCT Ps;
1156  HDC hDC;
1157 
1158  /* If already in Paint and Client area is not empty just return. */
1159  if (Wnd->state2 & WNDS2_STARTPAINT && !RECTL_bIsEmptyRect(&Wnd->rcClient))
1160  {
1161  ERR("In Paint and Client area is not empty!\n");
1162  return 0;
1163  }
1164 
1165  hDC = IntBeginPaint(Wnd, &Ps);
1166  if (hDC)
1167  {
1168  if (((Wnd->style & WS_MINIMIZE) != 0) && (Wnd->pcls->spicn))
1169  {
1170  RECT ClientRect;
1171  INT x, y;
1172 
1173  ERR("Doing Paint and Client area is empty!\n");
1174  IntGetClientRect(Wnd, &ClientRect);
1175  x = (ClientRect.right - ClientRect.left - UserGetSystemMetrics(SM_CXICON)) / 2;
1176  y = (ClientRect.bottom - ClientRect.top - UserGetSystemMetrics(SM_CYICON)) / 2;
1177  UserReferenceObject(Wnd->pcls->spicn);
1178  UserDrawIconEx(hDC, x, y, Wnd->pcls->spicn, 0, 0, 0, 0, DI_NORMAL | DI_COMPAT | DI_DEFAULTSIZE);
1179  UserDereferenceObject(Wnd->pcls->spicn);
1180  }
1181 
1182  IntEndPaint(Wnd, &Ps);
1183  }
1184  return (0);
1185  }
1186 
1187  case WM_SYNCPAINT:
1188  {
1189  HRGN hRgn;
1190  Wnd->state &= ~WNDS_SYNCPAINTPENDING;
1191  TRACE("WM_SYNCPAINT\n");
1192  hRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
1193  if (hRgn)
1194  {
1195  if (co_UserGetUpdateRgn(Wnd, hRgn, FALSE) != NULLREGION)
1196  {
1197  PREGION pRgn = REGION_LockRgn(hRgn);
1198  if (pRgn) REGION_UnlockRgn(pRgn);
1199  if (!wParam)
1201  co_UserRedrawWindow(Wnd, NULL, pRgn, wParam);
1202  }
1204  }
1205  return 0;
1206  }
1207 
1208  case WM_SETREDRAW:
1209  if (wParam)
1210  {
1211  if (!(Wnd->style & WS_VISIBLE))
1212  {
1213  IntSetStyle( Wnd, WS_VISIBLE, 0 );
1214  Wnd->state |= WNDS_SENDNCPAINT;
1215  }
1216  }
1217  else
1218  {
1219  if (Wnd->style & WS_VISIBLE)
1220  {
1222  IntSetStyle( Wnd, 0, WS_VISIBLE );
1223  }
1224  }
1225  return 0;
1226 
1227  case WM_WINDOWPOSCHANGING:
1228  {
1230  }
1231 
1232  case WM_WINDOWPOSCHANGED:
1233  {
1235  }
1236 
1237  case WM_NCCALCSIZE:
1238  {
1239  return NC_HandleNCCalcSize( Wnd, wParam, (RECTL *)lParam, FALSE );
1240  }
1241 
1242  case WM_NCACTIVATE:
1243  {
1244  return NC_HandleNCActivate( Wnd, wParam, lParam );
1245  }
1246 
1247  //
1248  // NC Paint mode.
1249  //
1250  case WM_NCPAINT:
1251  {
1253  Wnd->state |= WNDS_FORCEMENUDRAW;
1254  NC_DoNCPaint(Wnd, hDC, -1);
1255  Wnd->state &= ~WNDS_FORCEMENUDRAW;
1256  UserReleaseDC(Wnd, hDC, FALSE);
1257  return 0;
1258  }
1259  //
1260  // Draw Caption mode.
1261  //
1262  // wParam are DC_* flags.
1263  //
1264  case WM_NCUAHDRAWCAPTION:
1265  {
1267  TRACE("WM_NCUAHDRAWCAPTION: wParam DC_ flags %08x\n",wParam);
1268  UserDrawCaptionBar(Wnd, hDC, wParam | DC_FRAME); // Include DC_FRAME to comp for drawing glitch.
1269  UserReleaseDC(Wnd, hDC, FALSE);
1270  return 0;
1271  }
1272  //
1273  // Draw Frame mode.
1274  //
1275  // wParam is HDC, lParam are DC_ACTIVE and or DC_REDRAWHUNGWND.
1276  //
1277  case WM_NCUAHDRAWFRAME:
1278  {
1279  TRACE("WM_NCUAHDRAWFRAME: wParam hDC %p lParam DC_ flags %08x\n",wParam,lParam);
1281  return 0;
1282  }
1283 
1284  /* ReactOS only. */
1285  case WM_CBT:
1286  {
1287  switch (wParam)
1288  {
1289  case HCBT_MOVESIZE:
1290  {
1291  RECTL rt;
1292 
1293  if (lParam)
1294  {
1295  _SEH2_TRY
1296  {
1298  sizeof(RECT),
1299  1);
1300 
1301  RtlCopyMemory(&rt,
1302  (PVOID)lParam,
1303  sizeof(RECT));
1304  }
1306  {
1307  lResult = 1;
1308  }
1309  _SEH2_END;
1310  }
1311  if (!lResult)
1312  lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0);
1313  }
1314  break;
1315  }
1316  break;
1317  }
1318  break;
1319  }
1320  return lResult;
1321 }
_SEH2_TRY
Definition: create.c:4226
BYTE gafAsyncKeyState[256 *2/8]
Definition: keyboard.c:13
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1682
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WM_SYNCPAINT
Definition: winuser.h:1680
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define GA_ROOT
Definition: winuser.h:2779
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
#define WS_THICKFRAME
Definition: pedump.c:630
#define WM_SETHOTKEY
Definition: winuser.h:1642
#define HTLEFT
Definition: winuser.h:2477
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_PAINTICON
Definition: winuser.h:1631
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1346
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616
void FASTCALL MENU_InitSysMenuPopup(PMENU menu, DWORD style, DWORD clsStyle, LONG HitTest)
Definition: menu.c:1364
DWORD ExStyle
Definition: ntuser.h:699
#define HTHSCROLL
Definition: winuser.h:2471
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
Definition: cursoricon.c:1688
#define ID_NEXTLAYOUT
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1158
unsigned short RTL_ATOM
Definition: atom.c:42
#define SC_KEYMENU
Definition: winuser.h:2586
#define SC_RESTORE
Definition: winuser.h:2588
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
long y
Definition: polytest.cpp:48
BOOL FASTCALL IntClientToScreen(PWND Wnd, LPPOINT lpPoint)
Definition: winpos.c:198
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
Definition: rect.h:20
HWND FASTCALL co_UserSetFocus(PWND Window)
Definition: focus.c:1314
HGDIOBJ FASTCALL IntGetSysColorBrush(INT Object)
Definition: stockobj.c:317
long x
Definition: polytest.cpp:48
#define TPM_SYSTEM_MENU
Definition: undocuser.h:73
BOOL FASTCALL IntReleaseCapture(VOID)
Definition: focus.c:1530
#define TRUE
Definition: types.h:120
#define WM_CTLCOLORDLG
Definition: winuser.h:1760
#define WM_GETHOTKEY
Definition: winuser.h:1643
#define SW_HIDE
Definition: winuser.h:762
HWND FASTCALL UserGetActiveWindow(VOID)
Definition: focus.c:1429
#define VK_RMENU
Definition: winuser.h:2277
uint16_t * PWSTR
Definition: typedefs.h:56
#define WM_CLIENTSHUTDOWN
Definition: undocuser.h:35
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define WM_NCCALCSIZE
Definition: winuser.h:1675
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define WNDS_SENDNCPAINT
Definition: ntuser.h:611
#define WM_GETTEXT
Definition: winuser.h:1608
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
LRESULT FASTCALL DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:126
#define WARN(fmt,...)
Definition: debug.h:112
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
DWORD_PTR dwContextId
Definition: winuser.h:3306
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1748
#define HandleToUlong(h)
Definition: basetsd.h:79
static HDC
Definition: imagelist.c:92
HANDLE hItemHandle
Definition: winuser.h:3305
#define WM_SETREDRAW
Definition: winuser.h:1606
PSERVERINFO gpsi
Definition: imm.c:18
#define OBJID_WINDOW
Definition: winable.h:15
#define NULLREGION
Definition: wingdi.h:361
#define WH_SHELL
Definition: winuser.h:40
LONG top
Definition: windef.h:307
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define DI_COMPAT
Definition: wingdi.h:68
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
static HRGN hRgn
Definition: mapping.c:33
#define CS_NOCLOSE
Definition: winuser.h:649
#define DCX_USESTYLE
Definition: GetDCEx.c:10
#define MA_ACTIVATE
Definition: winuser.h:2491
#define VK_LEFT
Definition: winuser.h:2214
#define WM_SHOWWINDOW
Definition: winuser.h:1618
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1685
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
#define WM_CTLCOLOR
Definition: windowsx.h:29
BOOL WINAPI IntTrackPopupMenuEx(PMENU menu, UINT wFlags, int x, int y, PWND pWnd, LPTPMPARAMS lpTpm)
Definition: menu.c:4561
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
#define WM_NCHITTEST
Definition: winuser.h:1676
UINT_PTR WPARAM
Definition: windef.h:207
#define VK_LWIN
Definition: winuser.h:2225
#define VK_TAB
Definition: winuser.h:2189
#define VK_DOWN
Definition: winuser.h:2217
#define WS_CHILD
Definition: pedump.c:617
#define VK_MENU
Definition: winuser.h:2194
#define RDW_FRAME
Definition: winuser.h:1202
LONG left
Definition: windef.h:306
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:91
_SEH2_END
Definition: create.c:4400
HWND FASTCALL IntGetCaptureWindow(VOID)
Definition: focus.c:34
#define WNDS2_STARTPAINT
Definition: ntuser.h:638
#define VK_ESCAPE
Definition: winuser.h:2204
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:308
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1758
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
LRESULT FASTCALL DefWndHandleWindowPosChanging(PWND pWnd, WINDOWPOS *Pos)
Definition: defwnd.c:69
LRESULT FASTCALL DefWndGetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:477
int32_t INT
Definition: typedefs.h:58
#define VK_RETURN
Definition: winuser.h:2191
WPARAM wParam
Definition: combotst.c:138
#define DCX_INTERSECTRGN
Definition: winuser.h:2112
#define DCX_WINDOW
Definition: winuser.h:2103
LRESULT DefWndHandleSetCursor(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:244
#define QF_FF10STATUS
Definition: msgqueue.h:98
DWORD FASTCALL UserGetKeyState(DWORD dwKey)
Definition: msgqueue.c:221
#define QF_FMENUSTATUS
Definition: msgqueue.h:97
#define VK_F10
Definition: winuser.h:2254
#define WM_NCPAINT
Definition: winuser.h:1677
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TPM_RIGHTBUTTON
Definition: winuser.h:2370
#define L(x)
Definition: ntvdm.h:50
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
#define HTSYSMENU
Definition: winuser.h:2467
#define VK_UP
Definition: winuser.h:2215
#define DC_NC
Definition: winuser.h:440
#define FALSE
Definition: types.h:117
#define WM_NCACTIVATE
Definition: winuser.h:1678
#define WS_MINIMIZE
Definition: pedump.c:622
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
BOOLEAN co_UserDestroyWindow(PVOID Object)
Definition: window.c:2845
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
#define WM_NCRBUTTONUP
Definition: winuser.h:1686
#define WM_SETCURSOR
Definition: winuser.h:1626
BOOL FASTCALL GreDPtoLP(HDC, LPPOINT, INT)
Definition: dcutil.c:7
#define FIXME(fmt,...)
Definition: debug.h:111
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1761
#define WM_SYSCHAR
Definition: winuser.h:1711
#define SM_CXICON
Definition: winuser.h:966
#define VK_F4
Definition: winuser.h:2248
#define CHILDID_SELF
Definition: winable.h:14
#define SC_MAXIMIZE
Definition: winuser.h:2578
LRESULT NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:1042
#define VK_SHIFT
Definition: winuser.h:2192
Definition: object.h:3
#define DCX_KEEPCLIPRGN
Definition: undocuser.h:68
#define WM_ICONERASEBKGND
Definition: winuser.h:1632
HBRUSH FASTCALL DefWndControlColor(HDC hDC, UINT ctlType)
Definition: defwnd.c:33
static HWND hwndParent
Definition: cryptui.c:300
LRESULT FASTCALL DefWndHandleWindowPosChanged(PWND pWnd, WINDOWPOS *Pos)
Definition: defwnd.c:96
#define WM_KEYDOWN
Definition: winuser.h:1705
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1756
LONG_PTR LPARAM
Definition: windef.h:208
INT FASTCALL co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
Definition: painting.c:1785
PWND FASTCALL co_GetDesktopWindow(PWND pWnd)
Definition: desktop.c:1366
#define WH_CBT
Definition: winuser.h:35
#define DI_DEFAULTSIZE
Definition: wingdi.h:69
POINT MousePos
Definition: winuser.h:3307
Definition: region.h:7
#define WM_MOUSEACTIVATE
Definition: winuser.h:1627
#define WM_SETTEXT
Definition: winuser.h:1607
VOID FASTCALL DefWndScreenshot(PWND pWnd)
Definition: defwnd.c:500
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
HWND FASTCALL UserGetForegroundWindow(VOID)
Definition: focus.c:1421
#define WM_RBUTTONDOWN
Definition: winuser.h:1769
int iContextType
Definition: winuser.h:3303
void MENU_EndMenu(PWND pwnd)
Definition: menu.c:2664
DWORD FASTCALL IntGetWindowContextHelpId(PWND pWnd)
Definition: window.c:433
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
#define WM_APPCOMMAND
Definition: winuser.h:1872
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2518
HWND hwndSAS
Definition: winsta.c:24
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define KF_REPEAT
Definition: winuser.h:2440
#define WS_CAPTION
Definition: pedump.c:624
struct tagHELPINFO HELPINFO
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:65
VOID FASTCALL DefWndPrint(PWND pwnd, HDC hdc, ULONG uFlags)
Definition: defwnd.c:366
#define TRACE(s)
Definition: solgame.cpp:4
HWND FASTCALL IntFindWindow(PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom, PUNICODE_STRING WindowName)
Definition: window.c:3048
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const DWORD Style
Definition: appswitch.c:71
r parent
Definition: btrfs.c:3010
PMENU FASTCALL IntGetSystemMenu(PWND Window, BOOL bRevert)
Definition: menu.c:5383
__wchar_t WCHAR
Definition: xmlstorage.h:180
PWND MENU_IsMenuActive(VOID)
Definition: menu.c:2652
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RDW_ERASE
Definition: winuser.h:1201
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:46
#define DC_FRAME
Definition: undocuser.h:149
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1651
#define WM_CLOSE
Definition: winuser.h:1611
#define WM_KEYUP
Definition: winuser.h:1706
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC FASTCALL IntBeginPaint(PWND Window, PPAINTSTRUCT Ps)
Definition: painting.c:1435
#define HELPINFO_MENUITEM
Definition: winuser.h:1161
#define WM_RBUTTONUP
Definition: winuser.h:1770
#define WM_PRINT
Definition: winuser.h:1870
#define SC_PREVWINDOW
Definition: winuser.h:2581
#define WM_PAINT
Definition: winuser.h:1610
UINT FASTCALL DefWndGetHotKey(PWND pWnd)
Definition: hotkey.c:313
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
Definition: hook.c:1103
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1386
#define RDW_VALIDATE
Definition: winuser.h:1208
LRESULT NC_HandleNCCalcSize(PWND Wnd, WPARAM wparam, RECTL *Rect, BOOL Suspended)
Definition: nonclient.c:1249
struct Point Point
#define SM_CYICON
Definition: winuser.h:967
#define WNDS_SYNCPAINTPENDING
Definition: ntuser.h:623
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define VK_LMENU
Definition: winuser.h:2276
struct _WND::@4897 InternalPos
#define WM_CANCELMODE
Definition: winuser.h:1625
#define DI_NORMAL
Definition: wingdi.h:72
GLenum GLsizei len
Definition: glext.h:6722
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1768
#define LRESULT
Definition: ole.h:14
BOOL FASTCALL IntScreenToClient(PWND Wnd, LPPOINT lpPoint)
Definition: winpos.c:212
RECT rcWindow
Definition: ntuser.h:711
UINT cbSize
Definition: winuser.h:3302
#define WM_LOGONNOTIFY
Definition: undocuser.h:37
#define WM_COMMAND
Definition: winuser.h:1730
#define MA_NOACTIVATE
Definition: winuser.h:2493
#define HTBOTTOMRIGHT
Definition: winuser.h:2485
#define VK_RWIN
Definition: winuser.h:2226
#define WM_USER
Definition: winuser.h:1885
PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type)
Definition: window.c:3331
#define VK_RIGHT
Definition: winuser.h:2216
#define SC_MINIMIZE
Definition: winuser.h:2576
#define ERR(fmt,...)
Definition: debug.h:110
#define HTCAPTION
Definition: winuser.h:2466
Definition: ntuser.h:688
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:89
LRESULT NC_HandleNCLButtonDblClk(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: nonclient.c:1612
static HDC hDC
Definition: 3dtext.c:33
VOID UserDrawCaptionBar(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:900
INT FASTCALL DefWndSetHotKey(PWND pWnd, WPARAM wParam)
Definition: hotkey.c:340
#define WM_ACTIVATE
Definition: winuser.h:1602
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
#define RDW_ALLCHILDREN
Definition: winuser.h:1211
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
#define WM_SYSKEYUP
Definition: winuser.h:1710
LRESULT FASTCALL DefWndSetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:438
#define WM_CTLCOLOREDIT
Definition: winuser.h:1757
FORCEINLINE BOOL IntEqualRect(RECTL *lprc1, RECTL *lprc2)
Definition: winpos.h:48
#define WM_MBUTTONDOWN
Definition: winuser.h:1772
PWND FASTCALL IntGetParent(PWND Wnd)
Definition: window.c:208
int iCtrlId
Definition: winuser.h:3304
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LRESULT NC_HandleNCRButtonDown(PWND pwnd, WPARAM wParam, LPARAM lParam)
Definition: nonclient.c:1670
#define min(a, b)
Definition: monoChain.cc:55
#define WS_POPUP
Definition: pedump.c:616
BOOL FASTCALL IntEndPaint(PWND Wnd, PPAINTSTRUCT Ps)
Definition: painting.c:1532
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:399
#define VK_SPACE
Definition: winuser.h:2209
BOOL empty
Definition: button.c:170
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:1692
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define KF_ALTDOWN
Definition: winuser.h:2439
#define WM_DEVICECHANGE
Definition: winuser.h:1801
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define HTVSCROLL
Definition: winuser.h:2472
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1652
INT FASTCALL IntMenuItemFromPoint(PWND pWnd, HMENU hMenu, POINT ptScreen)
Definition: menu.c:1520
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392
#define RDW_ERASENOW
Definition: winuser.h:1209
#define SC_CLOSE
Definition: winuser.h:2582
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:47
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define WM_SYSKEYDOWN
Definition: winuser.h:1709
#define TPM_LEFTBUTTON
Definition: winuser.h:2369
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
Definition: window.c:147
#define HIWORD(l)
Definition: typedefs.h:247
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
LONG bottom
Definition: windef.h:309
#define IS_KEY_DOWN(ks, vk)
Definition: input.h:99
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define WNDS_FORCEMENUDRAW
Definition: ntuser.h:615
_In_ ULONG _In_ BOOLEAN Active
Definition: potypes.h:560
#define WA_INACTIVE
Definition: winuser.h:2612
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2090
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define SC_NEXTWINDOW
Definition: winuser.h:2580
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define LN_MESSAGE_BEEP
Definition: undocuser.h:120
LRESULT NC_HandleNCLButtonDown(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: nonclient.c:1520
#define HTCLIENT
Definition: winuser.h:2465
DWORD FASTCALL GetNCHitEx(PWND pWnd, POINT pt)
Definition: nonclient.c:1930
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT NC_HandleNCActivate(PWND Wnd, WPARAM wParam, LPARAM lParam)
Definition: nonclient.c:1383
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_SYSCOMMAND
Definition: winuser.h:1731
#define QF_FMENUSTATUSBREAK
Definition: msgqueue.h:96
struct @1595 Msg[]
LPARAM lParam
Definition: combotst.c:139
#define VK_SNAPSHOT
Definition: winuser.h:2221
#define LOWORD(l)
Definition: pedump.c:82
#define DC_TEXT
Definition: winuser.h:430
#define CS_PARENTDC
Definition: winuser.h:651
#define WM_KEYF1
Definition: msg.c:47
#define WM_CBT
Definition: undocuser.h:63
LRESULT IntClientShutdown(IN PWND pWindow, IN WPARAM wParam, IN LPARAM lParam)
Definition: shutdown.c:22
struct Rect Rect
#define RDW_INVALIDATE
Definition: winuser.h:1204
const DWORD ExStyle
Definition: appswitch.c:72
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1684
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731
#define WS_MAXIMIZE
Definition: pedump.c:623
DWORD style
Definition: ntuser.h:701

Referenced by GetControlColor(), NtUserMessageCall(), PopupMenuWndProc(), and UserMessageWindowProc().

◆ IntEnableWindow()

BOOL FASTCALL IntEnableWindow ( HWND  ,
BOOL   
)

Definition at line 224 of file window.c.

225 {
226  BOOL Update;
227  PWND pWnd;
228  UINT bIsDisabled;
229 
230  if(!(pWnd = UserGetWindowObject(hWnd)))
231  {
232  return FALSE;
233  }
234 
235  /* check if updating is needed */
236  bIsDisabled = !!(pWnd->style & WS_DISABLED);
237  Update = bIsDisabled;
238 
239  if (bEnable)
240  {
241  IntSetStyle( pWnd, 0, WS_DISABLED );
242  }
243  else
244  {
245  Update = !bIsDisabled;
246 
248 
249  /* Remove keyboard focus from that window if it had focus */
250  if (hWnd == IntGetThreadFocusWindow())
251  {
252  TRACE("IntEnableWindow SF NULL\n");
254  }
255  IntSetStyle( pWnd, WS_DISABLED, 0 );
256  }
257 
258  if (Update)
259  {
260  IntNotifyWinEvent(EVENT_OBJECT_STATECHANGE, pWnd, OBJID_WINDOW, CHILDID_SELF, 0);
262  }
263  // Return nonzero if it was disabled, or zero if it wasn't:
264  return bIsDisabled;
265 }
#define WS_DISABLED
Definition: pedump.c:621
HWND FASTCALL IntGetThreadFocusWindow(VOID)
Definition: focus.c:41
HWND FASTCALL co_UserSetFocus(PWND Window)
Definition: focus.c:1314
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
#define WM_ENABLE
Definition: winuser.h:1605
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CHILDID_SELF
Definition: winable.h:14
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define WM_CANCELMODE
Definition: winuser.h:1625
Definition: ntuser.h:688
_In_ BOOL bEnable
Definition: winddi.h:3426
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
Definition: window.c:147
DWORD style
Definition: ntuser.h:701

Referenced by NtUserCallTwoParam(), and NtUserEnableScrollBar().

◆ IntFindWindow()

HWND FASTCALL IntFindWindow ( PWND  Parent,
PWND  ChildAfter,
RTL_ATOM  ClassAtom,
PUNICODE_STRING  WindowName 
)

Definition at line 3048 of file window.c.

3052 {
3053  BOOL CheckWindowName;
3054  HWND *List, *phWnd;
3055  HWND Ret = NULL;
3056  UNICODE_STRING CurrentWindowName;
3057 
3058  ASSERT(Parent);
3059 
3060  CheckWindowName = WindowName->Buffer != 0;
3061 
3062  if((List = IntWinListChildren(Parent)))
3063  {
3064  phWnd = List;
3065  if(ChildAfter)
3066  {
3067  /* skip handles before and including ChildAfter */
3068  while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
3069  ;
3070  }
3071 
3072  /* search children */
3073  while(*phWnd)
3074  {
3075  PWND Child;
3076  if(!(Child = UserGetWindowObject(*(phWnd++))))
3077  {
3078  continue;
3079  }
3080 
3081  /* Do not send WM_GETTEXT messages in the kernel mode version!
3082  The user mode version however calls GetWindowText() which will
3083  send WM_GETTEXT messages to windows belonging to its processes */
3084  if (!ClassAtom || Child->pcls->atomNVClassName == ClassAtom)
3085  {
3086  // FIXME: LARGE_STRING truncated
3087  CurrentWindowName.Buffer = Child->strName.Buffer;
3088  CurrentWindowName.Length = (USHORT)min(Child->strName.Length, MAXUSHORT);
3089  CurrentWindowName.MaximumLength = (USHORT)min(Child->strName.MaximumLength, MAXUSHORT);
3090  if(!CheckWindowName ||
3091  (Child->strName.Length < 0xFFFF &&
3092  !RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE)))
3093  {
3094  Ret = Child->head.h;
3095  break;
3096  }
3097  }
3098  }
3100  }
3101 
3102  return Ret;
3103 }
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:533
unsigned int BOOL
Definition: ntddk_ex.h:94
THRDESKHEAD head
Definition: ntuser.h:690
#define ASSERT(a)
Definition: mode.c:44
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:278
Definition: ntuser.h:688
unsigned short USHORT
Definition: pedump.c:61
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define MAXUSHORT
Definition: typedefs.h:83
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
#define USERTAG_WINDOWLIST
Definition: tags.h:298
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by IntDefWindowProc(), and NtUserFindWindowEx().

◆ IntFreeHwndList()

VOID FASTCALL IntFreeHwndList ( PWINDOWLIST  pwlTarget)

Definition at line 1456 of file window.c.

1457 {
1458  PWINDOWLIST pwl, *ppwl;
1459 
1460  for (ppwl = &gpwlList; *ppwl; ppwl = &(*ppwl)->pNextList)
1461  {
1462  if (*ppwl != pwlTarget)
1463  continue;
1464 
1465  *ppwl = pwlTarget->pNextList;
1466 
1467  if (gpwlCache)
1468  {
1469  if (WL_CAPACITY(pwlTarget) > WL_CAPACITY(gpwlCache))
1470  {
1471  pwl = gpwlCache;
1472  gpwlCache = pwlTarget;
1474  }
1475  else
1476  {
1478  }
1479  }
1480  else
1481  {
1482  gpwlCache = pwlTarget;
1483  }
1484 
1485  break;
1486  }
1487 }
struct tagWINDOWLIST * pNextList
Definition: window.h:86
PWINDOWLIST gpwlCache
Definition: window.c:17
#define WL_CAPACITY(pwl)
Definition: window.h:97
PWINDOWLIST gpwlList
Definition: window.c:16
#define USERTAG_WINDOWLIST
Definition: tags.h:298
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by ExitThreadCallback(), IntAssociateInputContextEx(), IntCheckImeShowStatus(), and IntDestroyInputContext().

◆ IntGetClientRect()

VOID FASTCALL IntGetClientRect ( PWND  Wnd,
RECTL Rect 
)

Internal function. Returns client window rectangle relative to the upper-left corner of client area.

Note
Does not check the validity of the parameters

Definition at line 91 of file winpos.c.

92 {
93  ASSERT( Wnd );
94  ASSERT( Rect );
95  if (Wnd->style & WS_MINIMIZED)
96  {
97  Rect->left = Rect->top = 0;
100  return;
101  }
102  if (!UserIsDesktopWindow(Wnd))
103  {
104  *Rect = Wnd->rcClient;
106  }
107  else
108  {
109  Rect->left = Rect->top = 0;
110  Rect->right = Wnd->rcClient.right;
111  Rect->bottom = Wnd->rcClient.bottom;
112  /* Do this until Init bug is fixed. This sets 640x480, see InitMetrics.
113  Rect->right = UserGetSystemMetrics(SM_CXSCREEN);
114  Rect->bottom = UserGetSystemMetrics(SM_CYSCREEN);
115  */
116  }
117 }
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
#define SM_CXMINIMIZED
Definition: winuser.h:1014
LONG top
Definition: windef.h:307
RECT rcClient
Definition: ntuser.h:712
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
#define WS_MINIMIZED
Definition: undocuser.h:18
#define ASSERT(a)
Definition: mode.c:44
#define SM_CYMINIMIZED
Definition: winuser.h:1015
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
Definition: rect.h:31
LONG bottom
Definition: windef.h:309
DWORD style
Definition: ntuser.h:701

Referenced by co_IntDrawCaret(), co_WinPosArrangeIconicWindows(), co_WinPosGetMinMaxInfo(), co_WinPosSendSizeMove(), DefWndDoSizeMove(), DefWndHandleWindowPosChanged(), IntBeginPaint(), IntCalculateThumb(), IntDefWindowProc(), IntFillWindow(), IntGetScrollBarRect(), IntScrollWindowEx(), MENU_DrawPopupMenu(), MENU_EnsureMenuItemVisible(), NC_DoNCPaint(), and WinPosFindIconPos().

◆ IntGetNonChildAncestor()

PWND FASTCALL IntGetNonChildAncestor ( PWND  )

Definition at line 346 of file window.c.

347 {
348  while(pWnd && (pWnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
349  pWnd = pWnd->spwndParent;
350  return pWnd;
351 }
#define WS_CHILD
Definition: pedump.c:617
#define WS_POPUP
Definition: pedump.c:616

Referenced by co_IntProcessMouseMessage(), co_IntSetActiveWindow(), and IntCreateWindow().

◆ IntGetParent()

PWND FASTCALL IntGetParent ( PWND  Wnd)

Definition at line 208 of file window.c.

209 {
210  if (Wnd->style & WS_POPUP)
211  {
212  return Wnd->spwndOwner;
213  }
214  else if (Wnd->style & WS_CHILD)
215  {
216  return Wnd->spwndParent;
217  }
218 
219  return NULL;
220 }
#define WS_CHILD
Definition: pedump.c:617
struct _WND * spwndOwner
Definition: ntuser.h:710
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
struct _WND * spwndParent
Definition: ntuser.h:708
DWORD style
Definition: ntuser.h:701

Referenced by co_UserDestroyWindow(), DefSetText(), DefWndDoSizeMove(), DefWndHandleWindowPosChanged(), GetControlBrush(), IntDefWindowProc(), IntGetWindowContextHelpId(), MsqSendParentNotify(), NC_DoNCPaint(), NC_GetSysPopupPos(), NtUserCallHwndLock(), NtUserDefSetText(), and UserGetAncestor().

◆ IntGetWindow()

HWND FASTCALL IntGetWindow ( HWND  ,
UINT   
)

Definition at line 376 of file window.c.

378 {
379  PWND Wnd, FoundWnd;
380  HWND Ret = NULL;
381 
382  Wnd = ValidateHwndNoErr(hWnd);
383  if (!Wnd)
384  return NULL;
385 
386  FoundWnd = NULL;
387  switch (uCmd)
388  {
389  case GW_OWNER:
390  if (Wnd->spwndOwner != NULL)
391  FoundWnd = Wnd->spwndOwner;
392  break;
393 
394  case GW_HWNDFIRST:
395  if(Wnd->spwndParent != NULL)
396  {
397  FoundWnd = Wnd->spwndParent;
398  if (FoundWnd->spwndChild != NULL)
399  FoundWnd = FoundWnd->spwndChild;
400  }
401  break;
402  case GW_HWNDNEXT:
403  if (Wnd->spwndNext != NULL)
404  FoundWnd = Wnd->spwndNext;
405  break;
406 
407  case GW_HWNDPREV:
408  if (Wnd->spwndPrev != NULL)
409  FoundWnd = Wnd->spwndPrev;
410  break;
411 
412  case GW_CHILD:
413  if (Wnd->spwndChild != NULL)
414  FoundWnd = Wnd->spwndChild;
415  break;
416 
417  case GW_HWNDLAST:
418  FoundWnd = Wnd;
419  while ( FoundWnd->spwndNext != NULL)
420  FoundWnd = FoundWnd->spwndNext;
421  break;
422 
423  default:
424  Wnd = NULL;
425  break;
426  }
427 
428  if (FoundWnd != NULL)
429  Ret = UserHMGetHandle(FoundWnd);
430  return Ret;
431 }
#define GW_HWNDNEXT
Definition: winuser.h:756
PWND FASTCALL ValidateHwndNoErr(HWND hWnd)
Definition: window.c:118
#define GW_CHILD
Definition: winuser.h:758
HWND hWnd
Definition: settings.c:17
struct _WND * spwndOwner
Definition: ntuser.h:710
struct _WND * spwndNext
Definition: ntuser.h:706
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define GW_HWNDLAST
Definition: winuser.h:760
#define GW_HWNDFIRST
Definition: winuser.h:759
Definition: ntuser.h:688
#define NULL
Definition: types.h:112
#define GW_OWNER
Definition: winuser.h:761
struct _WND * spwndParent
Definition: ntuser.h:708
struct _WND * spwndChild
Definition: ntuser.h:709
#define GW_HWNDPREV
Definition: winuser.h:757
struct _WND * spwndPrev
Definition: ntuser.h:707

Referenced by WinPosFixupFlags().

◆ IntGetWindowBorderMeasures()

VOID FASTCALL IntGetWindowBorderMeasures ( PWND  WindowObject,
UINT cx,
UINT cy 
)

Definition at line 860 of file winpos.c.

861 {
862  if(HAS_DLGFRAME(Wnd->style, Wnd->ExStyle) && !(Wnd->style & WS_MINIMIZE))
863  {
866  }
867  else
868  {
869  if(HAS_THICKFRAME(Wnd->style, Wnd->ExStyle)&& !(Wnd->style & WS_MINIMIZE))
870  {
873  }
874  else if(HAS_THINFRAME(Wnd->style, Wnd->ExStyle))
875  {
878  }
879  else
880  {
881  *cx = *cy = 0;
882  }
883  }
884 }
#define SM_CYFRAME
Definition: winuser.h:990
#define SM_CXFRAME
Definition: winuser.h:988
#define WS_MINIMIZE
Definition: pedump.c:622
#define SM_CYDLGFRAME
Definition: winuser.h:962
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:585
#define HAS_THINFRAME(Style, ExStyle)
Definition: window.h:16
#define HAS_THICKFRAME(Style, ExStyle)
Definition: window.h:12
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
#define SM_CXDLGFRAME
Definition: winuser.h:960
#define SM_CYBORDER
Definition: winuser.h:959
#define SM_CXBORDER
Definition: winuser.h:958
_Out_opt_ int * cx
Definition: commctrl.h:585
#define HAS_DLGFRAME(Style, ExStyle)
Definition: window.h:8

◆ IntImeCanDestroyDefIME()

BOOL FASTCALL IntImeCanDestroyDefIME ( PWND  pImeWnd,
PWND  pwndTarget 
)

Definition at line 2072 of file ime.c.

2073 {
2074  PWND pwndNode;
2075  PIMEUI pimeui;
2076  IMEUI SafeImeUI;
2077 
2078  pimeui = ((PIMEWND)pImeWnd)->pimeui;
2079  if (!pimeui || (LONG_PTR)pimeui == (LONG_PTR)-1)
2080  return FALSE;
2081