forked from FlyWM/ShadowWidget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindWMAPI.h
46 lines (37 loc) · 1.2 KB
/
WindWMAPI.h
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
/**
* 去掉标题之后添加边框阴影
*
* windwmapi.h
* 封装windows api的头文件。
*
* FlyWM_
* GitHub: https://github.com/FlyWM
* CSDN: https://blog.csdn.net/a844651990
*
*/
#ifndef WINDWMAPI_H
#define WINDWMAPI_H
#include <windows.h>
typedef struct _MARGINS
{
int cxLeftWidth; // width of left border that retains its size
int cxRightWidth; // width of right border that retains its size
int cyTopHeight; // height of top border that retains its size
int cyBottomHeight; // height of bottom border that retains its size
} MARGINS, *PMARGINS;
class WinDwmapi
{
public:
WinDwmapi();
~WinDwmapi();
typedef HRESULT (WINAPI* DwmIsCompositionEnabledPtr)(BOOL* pfEnabled);
typedef HRESULT (WINAPI* DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
HRESULT DwmIsCompositionEnabled(BOOL* pfEnabled) const;
HRESULT DwmExtendFrameIntoClientArea(HWND hWnd, const MARGINS *pMarInset) const;
static const WinDwmapi* instance();
private:
DwmIsCompositionEnabledPtr dwm_is_composition_enabled_;
DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
HMODULE dwmapi_dll_;
};
#endif // WINDWMAPI_H