我认为要重绘就必定会有闪烁,以下代码实现绘制桌面:
HWND hWnd1=::FindWindow("Progman","Program Manager");
HWND hWnd2=::FindWindowEx(hWnd1,NULL,"SHELLDLL_DefView",NULL);
HWND hWnd=::FindWindowEx(hWnd2,NULL,"SysListView32",NULL);//这个就是桌面窗口句柄
CWnd* pWnd=CWnd::FromHandle(hWnd);
CDC* pDC=pWnd->GetDC();
pDC->Rectangle(100,100,200,200);
pWnd->InvalidateRect(&CRect(100,100,200,200));
HWND hWnd1=::FindWindow("Progman","Program Manager");
HWND hWnd2=::FindWindowEx(hWnd1,NULL,"SHELLDLL_DefView",NULL);
HWND hWnd=::FindWindowEx(hWnd2,NULL,"SysListView32",NULL);//这个就是桌面窗口句柄
CWnd* pWnd=CWnd::FromHandle(hWnd);
CDC* pDC=pWnd->GetDC();
pDC->Rectangle(100,100,200,200);
pWnd->InvalidateRect(&CRect(100,100,200,200));
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货