MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / CCustomButtonParent

Class CCustomButtonParent

WinArk/CustomButton.h:4–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "stdafx.h"
3
4class CCustomButtonParent :
5 public CWindowImpl<CCustomButtonParent>,
6 public CCustomDraw<CCustomButtonParent> {
7public:
8 void OnFinalMessage(HWND) override {
9 delete this;
10 }
11
12 BEGIN_MSG_MAP(CCustomButtonParent)
13 CHAIN_MSG_MAP(CCustomDraw<CCustomButtonParent>)
14 END_MSG_MAP()
15
16 DWORD OnPreErase(int, LPNMCUSTOMDRAW cd) {
17 if (cd->hdr.hwndFrom != m_hWnd) {
18 SetMsgHandled(FALSE);
19 return CDRF_DODEFAULT;
20 }
21 return CDRF_DODEFAULT;
22 }
23
24 DWORD OnPostErase(int, LPNMCUSTOMDRAW cd) {
25 if (cd->hdr.hwndFrom != m_hWnd) {
26 SetMsgHandled(FALSE);
27 return CDRF_DODEFAULT;
28 }
29 CDCHandle dc(cd->hdc);
30
31
32 return CDRF_DODEFAULT;
33 }
34
35 void Init(HWND hWnd) {
36 m_hWnd = hWnd;
37 ATLVERIFY(SubclassWindow(::GetParent(hWnd)));
38 }
39
40 HWND m_hWnd;
41};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected