我是用WINDOWS API写的,没有用MFC,现在我在ERASEBKGND事件中重绘窗体的背景图片,但是窗体中的BUTTON被刷没了,要怎么处理啊?
代码如下:
case WM_ERASEBKGND:
if(m_bHadLoad)
{ HDC pDC=GetDC(hwnd);
RECT rc;
long hmWidth=0;
long hmHeight=0;
m_lppi->get_Height(&hmHeight);
m_lppi->get_Width(&hmWidth);
GetClientRect(hwnd,&rc);
int nWidth,nHeight;
nWidth=rc.right-rc.left ;
nHeight=rc.bottom-rc.top;
//m_lppi是LPPicture接口
m_lppi->Render(pDC,0,0,nWidth,nHeight, 0,hmHeight,hmWidth,-hmHeight,NULL );
}
break;
代码如下:
case WM_ERASEBKGND:
if(m_bHadLoad)
{ HDC pDC=GetDC(hwnd);
RECT rc;
long hmWidth=0;
long hmHeight=0;
m_lppi->get_Height(&hmHeight);
m_lppi->get_Width(&hmWidth);
GetClientRect(hwnd,&rc);
int nWidth,nHeight;
nWidth=rc.right-rc.left ;
nHeight=rc.bottom-rc.top;
//m_lppi是LPPicture接口
m_lppi->Render(pDC,0,0,nWidth,nHeight, 0,hmHeight,hmWidth,-hmHeight,NULL );
}
break;
解决方案 »
- 如何编译《windows程序设计》中的showbit程序
- 请问谁有C++编写放大器的程序哦,单文档模式,毕业设计急用
- 求助关于双屏显示问题
- VC++6.0 Debug窗口环境下,Memory,Disassembly,Variables窗口关闭,怎么重新打开?
- 关于VC中字符显示的问题。。。
- 如果让数字字符串中的数字加1?
- ListCtrl的右键菜单问题
- MSDN?????
- 顶点格式与传入着色器问题
- 如何添加MFC的Messagemap中没有的消息的处理方法(如WM_HOTKEY)。
- 我现在做ADO,在子对话框中添加了combobox,想完成下拉列表,得到鼠标点击处的内容的功能,如下,有错
- 为什么我的http客户端程序在debug下可以运行, 在release下recv总是失败?
WM_ERASEBKGND只返回true