| 2 | #include "stdafx.h" |
| 3 | |
| 4 | class CCustomButtonParent : |
| 5 | public CWindowImpl<CCustomButtonParent>, |
| 6 | public CCustomDraw<CCustomButtonParent> { |
| 7 | public: |
| 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 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected