14#define UserHasDlgFrameStyle(Style, ExStyle) \
15 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
16 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
18#define UserHasThickFrameStyle(Style, ExStyle) \
19 (((Style) & WS_THICKFRAME) && \
20 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
22#define UserHasThinFrameStyle(Style, ExStyle) \
23 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
25#define ON_LEFT_BORDER(hit) \
26 (((hit) == HTLEFT) || ((hit) == HTTOPLEFT) || ((hit) == HTBOTTOMLEFT))
27#define ON_RIGHT_BORDER(hit) \
28 (((hit) == HTRIGHT) || ((hit) == HTTOPRIGHT) || ((hit) == HTBOTTOMRIGHT))
29#define ON_TOP_BORDER(hit) \
30 (((hit) == HTTOP) || ((hit) == HTTOPLEFT) || ((hit) == HTTOPRIGHT))
31#define ON_BOTTOM_BORDER(hit) \
32 (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
34#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
35 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
36 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
37 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \
38 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
254 RECT sizingRect, mouseRect, origRect, unmodRect, snapPreviewRect;
255 PRECT pFrameRect = &sizingRect;
259 POINT minTrack, maxTrack;
280 orgSnap = snap =
HTTOP;
294 TRACE(
"pwnd %p command %04lx, hittest %d, pos %d,%d\n",
295 pwnd, syscommand, hittest,
pt.x,
pt.y);
300 if (!hittest)
return;
304 if (!thickframe)
return;
325 origRect = sizingRect;
332 unmodRect = sizingRect;
344 unmodRect = sizingRect;
359 mouseRect.
top =
max( mouseRect.
top, sizingRect.
bottom-maxTrack.
y+capturePoint.
y-sizingRect.
top );
364 mouseRect.
top =
max( mouseRect.
top, sizingRect.
top+minTrack.
y+capturePoint.
y-sizingRect.
bottom );
421 if (hittest ==
HTCAPTION && thickframe &&
462 dx =
pt.x - capturePoint.
x;
463 dy =
pt.y - capturePoint.
y;
475 else if (!DragFullWindows)
485 RECT newRect = unmodRect;
487 if (!iconic && !DragFullWindows)
490 pFrameRect = &sizingRect;
497 if (snap && syscommand ==
SC_MOVE && !iconic &&
533 else if (!snap && syscommand ==
SC_MOVE && !iconic)
544 pFrameRect = &snapPreviewRect;
582 if (!DragFullWindows)
627 sizingRect = newRect;
632 pwnd->
head.pti->TIF_flags &= ~TIF_MOVESIZETRACKING;
652 UINT eraseFinalFrame = moved && !DragFullWindows;
664 ERR(
"DoSizeMove : WH_CBT Call Hook return!\n");
679 BOOL forceSizing = !iconic && hittest ==
HTCAPTION && (!!orgSnap != !!snap);
688 if (!DragFullWindows || iconic)
696 if (orgSnap && !snap)
703 sizingRect.
bottom - sizingRect.
top, swp);
714 else if (DragFullWindows)
896 WindowRect.
left = WindowRect.
top = 0;
958 RECT WindowRect, CurrentRect, TempRect;
965 TRACE(
"UserDrawCaptionBar: pWnd %p, hDc %p, Flags 0x%x.\n", pWnd,
hDC,
Flags);
972 CurrentRect.
top = CurrentRect.
left = 0;
1003 TempRect = CurrentRect;
1009 Flags |= DC_GRADIENT;
1068 TempRect = CurrentRect;
1098 RECT WindowRect, CurrentRect, TempRect;
1134 CurrentRect.
top = CurrentRect.
left = 0;
1170 Flags &= ~DC_REDRAWHUNGWND;
1176 Flags |= DC_GRADIENT;
1185 ERR(
"Wnd is active and not set active!\n");
1189 TempRect = CurrentRect;
1243 TempRect = CurrentRect;
1259 RECT ParentClientRect;
1261 TempRect = CurrentRect;
1315 Wnd->
state &= ~WNDS_HASCAPTION;
1364 CliRect.
top -= OrigRect.
top;
1450 Wnd->
state &= ~WNDS_ACTIVEFRAME;
1558 if (Pressed != OldState)
1707 mouseRect.bottom - mouseRect.top,
1767 RECT WindowRect, ClientRect, OrigWndRect;
1778 OrigWndRect = WindowRect;
1898 ClientPoint =
Point;
1902 if (
PtInRect(&ClientRect, ClientPoint))
1922 RECT ParentRect, TempRect = WindowRect, TempRect2 = WindowRect;
1941 TempRect.
top = TempRect2.top;
1942 TempRect.
bottom = TempRect2.bottom;
1958 RECT TempRect = WindowRect;
1969 RECT TempRect = WindowRect;
1984 RECT rcWindow, rcClient;
2019 if (
pt.y < rcWindow.
top)
2033 if (
pt.x < rcWindow.
left)
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
#define UlongToHandle(ul)
#define DBG_DEFAULT_CHANNEL(ch)
struct _CURICON_OBJECT * PCURICON_OBJECT
COLORREF FASTCALL IntSetDCPenColor(HDC, COLORREF)
static BOOL UserHasWindowEdge(DWORD Style, DWORD ExStyle)
static LRESULT DefWndNCHitTest(HWND hWnd, POINT Point)
PUSER_MESSAGE_QUEUE gpqForeground
HWND FASTCALL co_UserSetCapture(HWND hWnd)
HWND APIENTRY IntGetCapture(VOID)
BOOL FASTCALL IntReleaseCapture(VOID)
BOOL FASTCALL co_IntSetForegroundWindowMouse(PWND Window)
HWND FASTCALL UserGetActiveWindow(VOID)
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
#define WNDS_HASHORIZONTALSCROLLBAR
#define UserHMGetHandle(obj)
#define MSQ_STATE_MOVESIZE
#define WNDS_FORCEMENUDRAW
#define WNDS_HASVERTICALSCROOLLBAR
#define TIF_MOVESIZETRACKING
HGDIOBJ FASTCALL IntGetSysColorBrush(INT Object)
BOOL FASTCALL GreMoveTo(HDC hdc, INT x, INT y, LPPOINT pptOut)
DWORD FASTCALL IntGetSysColor(INT nIndex)
HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd)
int UserShowCursor(BOOL bShow)
PCURICON_OBJECT FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange)
__kernel_entry W32KAPI INT APIENTRY NtGdiCombineRgn(_In_ HRGN hrgnDst, _In_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ INT iMode)
__kernel_entry W32KAPI HBRUSH APIENTRY NtGdiSelectBrush(_In_ HDC hdc, _In_ HBRUSH hbrush)
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiGetStockObject(_In_ INT iObject)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
__kernel_entry W32KAPI HPEN APIENTRY NtGdiSelectPen(_In_ HDC hdc, _In_ HPEN hpen)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiLineTo(_In_ HDC hdc, _In_ INT x, _In_ INT y)
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
BOOL FASTCALL IntClientToScreen(PWND Wnd, LPPOINT lpPoint)
VOID FASTCALL IntSetSnapInfo(PWND Wnd, UINT Edge, IN const RECT *Pos OPTIONAL)
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
VOID FASTCALL co_IntSnapWindow(PWND Wnd, UINT Edge)
VOID FASTCALL co_IntCalculateSnapPosition(PWND Wnd, UINT Edge, OUT RECT *Pos)
BOOL FASTCALL IntGetWindowRect(PWND Wnd, RECTL *Rect)
UINT FASTCALL co_WinPosGetMinMaxInfo(PWND Window, POINT *MaxSize, POINT *MaxPos, POINT *MinTrack, POINT *MaxTrack)
VOID UserGetWindowBorders(DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient)
UINT FASTCALL IntGetWindowSnapEdge(PWND Wnd)
VOID FASTCALL IntSetSnapEdge(PWND Wnd, UINT Edge)
#define WS_EX_DLGMODALFRAME
#define GreCreateRectRgnIndirect(prc)
struct _CURICON_OBJECT * spicn
struct _CURICON_OBJECT * spicnSm
struct _WND::@5116 InternalPos
TW_UINT32 TW_UINT16 TW_UINT16 MSG
BOOL UserDrawCaption(PWND pWnd, HDC hDc, RECTL *lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING Str, UINT uFlags)
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
VOID FASTCALL UpdateThreadWindows(PWND pWnd, PTHREADINFO pti, HRGN hRgn)
VOID FASTCALL co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
HDC FASTCALL UserGetWindowDC(PWND Wnd)
PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type)
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
#define HAS_MENU(hwnd, style)
#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
VOID FASTCALL RECTL_vInflateRect(_Inout_ RECTL *rect, _In_ INT dx, _In_ INT dy)
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
BOOL UserSetCursorPos(INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
BOOL APIENTRY UserClipCursor(RECTL *prcl)
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
PWND FASTCALL UserGetDesktopWindow(VOID)
#define UserIsDesktopWindow(pWnd)
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
BOOL FASTCALL IntTranslateKbdMessage(LPMSG lpMsg, UINT flags)
BOOL FASTCALL IntCallMsgFilter(LPMSG lpmsg, INT code)
LRESULT FASTCALL IntDispatchMessage(PMSG pMsg)
BOOL APIENTRY co_IntGetPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg, BOOL bGMSG)
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
LONG NTAPI UserGetSystemMetrics(ULONG Index)
BOOL IntIsScrollBarVisible(PWND pWnd, INT hBar)
PCURICON_OBJECT FASTCALL NC_IconForWindow(PWND pWnd)
LRESULT NC_HandleNCLButtonDown(PWND pWnd, WPARAM wParam, LPARAM lParam)
VOID UserDrawCaptionBar(PWND pWnd, HDC hDC, INT Flags)
DWORD FASTCALL GetNCHitEx(PWND pWnd, POINT pt)
VOID FASTCALL UserDrawWindowFrame(HDC hdc, RECTL *rect, ULONG width, ULONG height)
static UINT GetSnapActivationPoint(PWND Wnd, POINT pt)
#define ON_BOTTOM_BORDER(hit)
#define UserHasDlgFrameStyle(Style, ExStyle)
BOOL UserDrawSysMenuButton(PWND pWnd, HDC hDC, LPRECT Rect, BOOL Down)
VOID FASTCALL DefWndDoSizeMove(PWND pwnd, WORD wParam)
void FASTCALL NC_GetSysPopupPos(PWND Wnd, RECT *Rect)
#define UserHasThickFrameStyle(Style, ExStyle)
LRESULT NC_HandleNCActivate(PWND Wnd, WPARAM wParam, LPARAM lParam)
VOID NC_DoButton(PWND pWnd, WPARAM wParam, LPARAM lParam)
VOID UserDrawCaptionButton(PWND pWnd, LPRECT Rect, DWORD Style, DWORD ExStyle, HDC hDC, BOOL bDown, ULONG Type)
LRESULT NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
#define UserHasThinFrameStyle(Style, ExStyle)
#define ON_TOP_BORDER(hit)
LONG FASTCALL DefWndStartSizeMove(PWND Wnd, WPARAM wParam, POINT *capturePoint)
LRESULT NC_HandleNCCalcSize(PWND Wnd, WPARAM wparam, RECTL *Rect, BOOL Suspended)
LRESULT NC_HandleNCRButtonDown(PWND pwnd, WPARAM wParam, LPARAM lParam)
static INT NC_DoNCActive(PWND Wnd)
void FASTCALL NC_GetInsideRect(PWND Wnd, RECT *rect)
#define ON_RIGHT_BORDER(hit)
#define ON_LEFT_BORDER(hit)
LRESULT NC_HandleNCLButtonDblClk(PWND pWnd, WPARAM wParam, LPARAM lParam)
VOID UserDrawCaptionButtonWnd(PWND pWnd, HDC hDC, BOOL bDown, ULONG Type)
VOID NC_DrawFrame(HDC hDC, RECT *CurrentRect, BOOL Active, DWORD Style, DWORD ExStyle)
VOID FASTCALL UserDrawMovingFrame(HDC hdc, RECTL *rect, BOOL thickframe)
BOOL FASTCALL UserDereferenceObject(PVOID Object)
PUSER_HANDLE_TABLE gHandleTable
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
VOID FASTCALL UserReferenceObject(PVOID obj)
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
BOOL g_bWindowSnapEnabled
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
PWND FASTCALL IntGetParent(PWND Wnd)
BOOL FASTCALL IntIsWindow(HWND hWnd)
BOOL FASTCALL IntIsChildWindow(PWND Parent, PWND BaseWindow)
BOOL FASTCALL IntIsWindowVisible(PWND Wnd)
#define HAS_DLGFRAME(Style, ExStyle)
INT FASTCALL IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints)
#define HAS_CLIENTFRAME(Style, ExStyle)
#define HAS_THINFRAME(Style, ExStyle)
#define HAS_THICKFRAME(Style, ExStyle)
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
FORCEINLINE BOOLEAN IntIsWindowSnapped(PWND Wnd)
FORCEINLINE BOOL IntEqualRect(RECTL *lprc1, RECTL *lprc2)
FORCEINLINE BOOLEAN IntIsSnapAllowedForWindow(PWND Wnd)
#define COLOR_INACTIVECAPTIONTEXT
#define GetWindowLongPtrW
#define COLOR_WINDOWFRAME
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define DFCS_CAPTIONCLOSE
#define COLOR_ACTIVECAPTION
#define DFCS_SCROLLSIZEGRIP
#define COLOR_INACTIVECAPTION
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define DFCS_CAPTIONRESTORE
#define COLOR_ACTIVEBORDER
#define STATE_SYSTEM_OFFSCREEN
HWND WINAPI GetParent(_In_ HWND)
struct tagSCROLLBARINFO SCROLLBARINFO
#define WS_EX_LEFTSCROLLBAR
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_BTNHIGHLIGHT
#define COLOR_INACTIVEBORDER
#define COLOR_CAPTIONTEXT
int WINAPI GetSystemMetrics(_In_ int)
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
_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
_Must_inspect_result_ _In_ ULONG Flags
_In_ ULONG _In_ BOOLEAN Active