1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#pragma once
#include <windows.h>
inline BOOL UnadjustWindowRect(
LPRECT prc,
DWORD dwStyle,
BOOL fMenu)
{
RECT rc;
SetRectEmpty(&rc);
BOOL fRc = AdjustWindowRect(&rc, dwStyle, fMenu);
if (fRc) {
prc->left -= rc.left;
prc->top -= rc.top;
prc->right -= rc.right;
prc->bottom -= rc.bottom;
}
return fRc;
}
inline BOOL UnadjustWindowRectEx(
LPRECT prc,
DWORD dwStyle,
BOOL fMenu,
DWORD dwExStyle)
{
RECT rc;
SetRectEmpty(&rc);
BOOL fRc = AdjustWindowRectEx(&rc, dwStyle, fMenu, dwExStyle);
if (fRc) {
prc->left -= rc.left;
prc->top -= rc.top;
prc->right -= rc.right;
prc->bottom -= rc.bottom;
}
return fRc;
}
inline RECT Rect(POINT p1, POINT p2)
{
return { p1.x, p1.y, p2.x, p2.y };
}
inline RECT Rect(POINT p1, SIZE s2)
{
return { p1.x, p1.y, p1.x + s2.cx, p1.y + s2.cy };
}
inline HFONT CreateFont(LPTSTR pFontFace, int iFontHeight, int cWeight, BOOL bItalic, BOOL bUnderline)
{
return CreateFont(iFontHeight, 0, 0, 0, cWeight, bItalic, bUnderline, FALSE, ANSI_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE, pFontFace);
}
|