所以我使用编写here的代码重新绘制静态文本,但我注意到每次我这样做时系统会把它带到后面(静态图片后面)和我无法看到它。有没有办法让它恢复原状或防止这种行为?
我用来重绘它的代码:
vHWND =控制的HWND
wHWND = Window' HWND
RECT rect;
GetClientRect(vHWND, &rect);
InvalidateRect(vHWND, &rect, TRUE);
MapWindowPoints(vHWND, wHWND, (POINT *)&rect, 2);
RedrawWindow(wHWND, &rect, NULL, RDW_ERASE | RDW_INVALIDATE);
具有透明bg的代码:
case WM_CTLCOLORSTATIC: //Draw views transparent background
{
SetBkMode((HDC)wParam, TRANSPARENT); //BG Transp
return (LRESULT)GetStockObject(HOLLOW_BRUSH);
break;
}
答案 0 :(得分:-1)
没关系,我用SetWindowPos解决了它。