1 Star 2 Fork 4

初雨团队 / CPPHelper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
DoubleBuffer.h 913 Bytes
一键复制 编辑 原始数据 按行查看 历史
mingkuang 提交于 2017-03-02 16:06 . CPP Helper定期同步
#pragma once
//#include <atltypes.h>
//#include <atlcrack.h>
#define MSG_WM_PAINT_Window(func) \
if (uMsg == WM_PAINT) \
{ \
SetMsgHandled(TRUE); \
func(hWnd,(HDC)wParam); \
lResult = 0; \
if(IsMsgHandled()) \
return TRUE; \
}
class CDoubleBuffer
{
public:
BEGIN_MSG_MAP_EX(CDoubleBuffer)
MSG_WM_ERASEBKGND(OnEraseBkgnd)
MSG_WM_PAINT_Window(OnPaint)
END_MSG_MAP()
BOOL OnEraseBkgnd(CDCHandle dc)
{
return TRUE;
}
void OnPaint(CWindow hWnd, HDC dc)
{
if (dc)
{
RECT rect;
hWnd.GetClientRect(&rect);
CMemoryDC dcMem(dc, rect);
dcMem.FillSolidRect(&rect, GetSysColor(COLOR_WINDOW));
DefWindowProc(hWnd, WM_PAINT, (WPARAM)dcMem.m_hDC, 0);
}
else
{
CPaintDC dc(hWnd);
CMemoryDC dcMem(dc.m_hDC, dc.m_ps.rcPaint);
dcMem.FillSolidRect(&dc.m_ps.rcPaint, GetSysColor(COLOR_WINDOW));
DefWindowProc(hWnd, WM_PAINT, (WPARAM)dcMem.m_hDC, 0);
}
}
};
C++
1
https://gitee.com/Chuyu-Team/CPPHelper.git
git@gitee.com:Chuyu-Team/CPPHelper.git
Chuyu-Team
CPPHelper
CPPHelper
master

搜索帮助