-
Notifications
You must be signed in to change notification settings - Fork 151
/
DialogCTL.h
51 lines (37 loc) · 1.03 KB
/
DialogCTL.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
47
48
49
50
51
#pragma once
#include "stdafx.h"
#define MSG_WM_ERASEBKGNDWithHWND(func) \
if (uMsg == WM_ERASEBKGND) \
{ \
SetMsgHandled(TRUE); \
lResult = (LRESULT)func(hWnd,(HDC)wParam); \
if (IsMsgHandled()) \
return TRUE; \
}
class CDialogCTL
{
public:
BEGIN_MSG_MAP_EX(CDialogCTL)
//MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
MSG_WM_ERASEBKGNDWithHWND(OnEraseBkgnd)
MESSAGE_RANGE_HANDLER(WM_CTLCOLORMSGBOX, WM_CTLCOLORSTATIC, OnCtlColor)
//MSG_WM_CTLCOLORSTATIC(OnCtlColorStatic)
//MSG_WM_CTLCOLORDLG(OnCtlColorStatic)
//MSG_WM_CTLCOLORBTN(OnCtlColorStatic)
END_MSG_MAP()
HRESULT OnCtlColor(int /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CDCHandle dc((HDC)wParam);
dc.SetBkMode(TRANSPARENT);
//dc.SetBkColor(REG());
//dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
return (HRESULT)GetSysColorBrush(/*COLOR_WINDOWFRAME*/COLOR_WINDOW);
}
BOOL OnEraseBkgnd(CWindow hWnd, CDCHandle dc)
{
RECT Rect;
hWnd.GetClientRect(&Rect);
dc.FillSolidRect(&Rect, RGB(255, 255, 255));
return TRUE;
}
};