ReactOS 0.4.16-dev-197-g92996da
nonclient.c File Reference
#include <user32.h>
Include dependency graph for nonclient.c:

Go to the source code of this file.

Macros

#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect)
 
#define DOUBLE_BUFFER_CAPTION
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
BOOL UserHasWindowEdge (DWORD Style, DWORD ExStyle)
 
VOID UserGetWindowBorders (DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient)
 
BOOL WINAPI RealUserDrawCaption (HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags)
 
BOOL WINAPI RealAdjustWindowRectEx (LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
 
BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx (LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
 
BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRect (LPRECT lpRect, DWORD dwStyle, BOOL bMenu)
 
BOOL WINAPI DrawCaption (HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
 
BOOL WINAPI DrawCaptionTempW (HWND hWnd, HDC hDC, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags)
 
BOOL WINAPI DrawCaptionTempA (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCSTR str, UINT uFlags)
 

Macro Definition Documentation

◆ DOUBLE_BUFFER_CAPTION

#define DOUBLE_BUFFER_CAPTION

Definition at line 166 of file nonclient.c.

◆ HASSIZEGRIP

#define HASSIZEGRIP (   Style,
  ExStyle,
  ParentStyle,
  WindowRect,
  ParentClientRect 
)
Value:
((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
(WindowRect.right - WindowRect.left == ParentClientRect.right) && \
(WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
const DWORD Style
Definition: appswitch.c:71
#define WS_CHILD
Definition: pedump.c:617
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_THICKFRAME
Definition: pedump.c:630

Definition at line 26 of file nonclient.c.

Function Documentation

◆ AdjustWindowRect()

BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRect ( LPRECT  lpRect,
DWORD  dwStyle,
BOOL  bMenu 
)

Definition at line 158 of file nonclient.c.

161{
162 return AdjustWindowRectEx(lpRect, dwStyle, bMenu, 0);
163}
BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Definition: nonclient.c:123

◆ AdjustWindowRectEx()

BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx ( LPRECT  lpRect,
DWORD  dwStyle,
BOOL  bMenu,
DWORD  dwExStyle 
)

Definition at line 123 of file nonclient.c.

127{
128 BOOL Hook, Ret = FALSE;
129
131
133
134 /* Bypass SEH and go direct. */
135 if (!Hook) return RealAdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
136
138 {
139 Ret = guah.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
140 }
142 {
143 }
144 _SEH2_END;
145
147
148 return Ret;
149}
#define FALSE
Definition: types.h:117
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
ADJUSTWINDOWRECTEX AdjustWindowRectEx
Definition: undocuser.h:351
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
USERAPIHOOK guah
Definition: usrapihk.c:344
static __inline void LoadUserApiHook()
Definition: user_x.h:85
BOOL WINAPI RealAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Definition: nonclient.c:90

Referenced by AdjustWindowRect().

◆ DrawCaption()

BOOL WINAPI DrawCaption ( HWND  hWnd,
HDC  hDC,
LPCRECT  lprc,
UINT  uFlags 
)

Definition at line 172 of file nonclient.c.

173{
174 BOOL Hook, Ret = FALSE;
175
177
179
180 /* Bypass SEH and go direct. */
181 if (!Hook) return NtUserDrawCaption(hWnd, hDC, lprc, uFlags);
182
184 {
186 }
188 {
189 }
190 _SEH2_END;
191
193
194 return Ret;
195}
static HDC hDC
Definition: 3dtext.c:33
HWND hWnd
Definition: settings.c:17
UINT uFlags
Definition: api.c:59
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2457
DRAWCAPTION DrawCaption
Definition: undocuser.h:364
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4469

◆ DrawCaptionTempA()

BOOL WINAPI DrawCaptionTempA ( HWND  hwnd,
HDC  hdc,
const RECT rect,
HFONT  hFont,
HICON  hIcon,
LPCSTR  str,
UINT  uFlags 
)

Definition at line 222 of file nonclient.c.

231{
232 LPWSTR strW;
233 INT len;
234 BOOL ret = FALSE;
235
236 if (!(uFlags & DC_TEXT) || !str)
238
239 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
240 if ((strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
241 {
245 }
246 return ret;
247}
HFONT hFont
Definition: main.c:53
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
HDC hdc
Definition: main.c:9
WCHAR strW[12]
Definition: clipboard.c:2029
HICON hIcon
Definition: msconfig.c:44
const WCHAR * str
& rect
Definition: startmenu.cpp:1413
int32_t INT
Definition: typedefs.h:58
int ret
BOOL WINAPI DrawCaptionTempW(HWND hWnd, HDC hDC, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags)
Definition: nonclient.c:202
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define DC_TEXT
Definition: winuser.h:430
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ DrawCaptionTempW()

BOOL WINAPI DrawCaptionTempW ( HWND  hWnd,
HDC  hDC,
const RECT rect,
HFONT  hFont,
HICON  hIcon,
LPCWSTR  str,
UINT  uFlags 
)

Definition at line 202 of file nonclient.c.

211{
212 UNICODE_STRING Text = {0};
215}
char * Text
Definition: combotst.c:136
BOOL NTAPI NtUserDrawCaptionTemp(HWND hWnd, HDC hDC, LPCRECT lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING str, UINT uFlags)
Definition: painting.c:2374
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by DrawCaptionTempA().

◆ RealAdjustWindowRectEx()

BOOL WINAPI RealAdjustWindowRectEx ( LPRECT  lpRect,
DWORD  dwStyle,
BOOL  bMenu,
DWORD  dwExStyle 
)

Definition at line 90 of file nonclient.c.

94{
95 SIZE BorderSize;
96
97 if (bMenu)
98 {
99 lpRect->top -= GetSystemMetrics(SM_CYMENU);
100 }
101 if ((dwStyle & WS_CAPTION) == WS_CAPTION)
102 {
103 if (dwExStyle & WS_EX_TOOLWINDOW)
105 else
107 }
108 UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE);
110 lpRect,
111 BorderSize.cx,
112 BorderSize.cy);
113
114 return TRUE;
115}
#define TRUE
Definition: types.h:120
VOID UserGetWindowBorders(DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient)
Definition: winpos.c:894
#define WS_CAPTION
Definition: pedump.c:624
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG top
Definition: windef.h:307
#define SM_CYMENU
Definition: winuser.h:979
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMCAPTION
Definition: winuser.h:1017
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CYCAPTION
Definition: winuser.h:966
int WINAPI GetSystemMetrics(_In_ int)

Referenced by AdjustWindowRectEx(), and ResetUserApiHook().

◆ RealUserDrawCaption()

BOOL WINAPI RealUserDrawCaption ( HWND  hWnd,
HDC  hDC,
LPCRECT  lpRc,
UINT  uFlags 
)

Definition at line 80 of file nonclient.c.

81{
82 ERR("Real DC flags %08x\n",uFlags);
83 return NtUserDrawCaption(hWnd, hDC, lpRc, uFlags);
84}
#define ERR(fmt,...)
Definition: precomp.h:57

Referenced by ResetUserApiHook().

◆ UserGetWindowBorders()

VOID UserGetWindowBorders ( DWORD  Style,
DWORD  ExStyle,
SIZE Size,
BOOL  WithClient 
)

Definition at line 53 of file nonclient.c.

54{
55 DWORD Border = 0;
56
58 Border += 2;
59 else if (ExStyle & WS_EX_STATICEDGE)
60 Border += 1;
61 if ((ExStyle & WS_EX_CLIENTEDGE) && WithClient)
62 Border += 2;
64 Border ++;
65 Size->cx = Size->cy = Border;
66 if ((Style & WS_THICKFRAME) && !(Style & WS_MINIMIZE))
67 {
70 }
73}
const DWORD ExStyle
Definition: appswitch.c:72
static BOOL UserHasWindowEdge(DWORD Style, DWORD ExStyle)
Definition: nonclient.c:46
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_MINIMIZE
Definition: pedump.c:622
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define SM_CXFRAME
Definition: winuser.h:997
#define SM_CYFRAME
Definition: winuser.h:999
#define SM_CYBORDER
Definition: winuser.h:968
#define SM_CXBORDER
Definition: winuser.h:967
#define SM_CXDLGFRAME
Definition: winuser.h:969
#define SM_CYDLGFRAME
Definition: winuser.h:971
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

◆ UserHasWindowEdge()

BOOL UserHasWindowEdge ( DWORD  Style,
DWORD  ExStyle 
)

Definition at line 36 of file nonclient.c.

37{
38 if (Style & WS_MINIMIZE)
39 return TRUE;
41 return TRUE;
43 return FALSE;
44 if (Style & WS_THICKFRAME)
45 return TRUE;
47 if (Style == WS_DLGFRAME || Style == WS_CAPTION)
48 return TRUE;
49 return FALSE;
50}
#define WS_DLGFRAME
Definition: pedump.c:626

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )