hi,all,
帮我看看吧!实在搞不定了.
由于我在线程内绘图,有可能会有其它的问题,我今天又重新改了,程式如下:
void wave_out(HDC hdc){
int temp_i;
HBRUSH hbrush;
HPEN hpen;
hbrush=CreateSolidBrush(RGB(0,0,0));
hpen=CreatePen(PS_SOLID,0,RGB(75,75,35));
SelectObject(hbg_dc,hbrush);
SelectObject(hbg_dc,hpen);
FillRect(hbg_dc,&displayrect,hbrush);
for(temp_i=0;temp_i<12;temp_i++){
MoveToEx(hbg_dc,temp_i*50,0,NULL);
LineTo(hbg_dc,temp_i*50,370);
}
for(temp_i=0;temp_i<7;temp_i++){
MoveToEx(hbg_dc,0,temp_i*50,NULL);
LineTo(hbg_dc,600,temp_i*50);
}
BitBlt(hbg_dc,0,0,600,350,hdg_dc,0,0,SRCPAINT);
BitBlt(hdc,20,190,720,450,hbg_dc,0,0,SRCCOPY);
DeleteObject(hpen);
DeleteObject(hbrush);
}
然后在WndProc程序内启动一个定时器,再在定时器消息内写了如下三行程式:
HDC hdc;
///////////////////////每50毫秒调用一次.(Timer interval=50ms).
GetDC(hWnd);
wave_out(hdc);
ReleaseDC(hWnd,hdc);
刚开始正常画面.在窗口内出现了方格.可是过那么两分钟后,首先窗口出现了两个,一个向上偏移了2Cm,然后将鼠标移到关闭图标时,
关闭图标也向上出现了一个同样的关闭图标.再按住标题栏左右移动,整个屏幕到处都是白色的一块一块的.其它的应用程式显示乱.
请大家帮忙看看.