在视图类的左键消息中,动态创建窗口,样式改为子窗口时窗口就不刷新了,如何处理让子窗口能够刷新呢?
CWnd * wnd = new CWnd;
创建浮动窗口:
wnd->CreateEx(NULL,AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW , NULL,
(HBRUSH) ::GetStockObject(WHITE_BRUSH),NULL), //if pass null, do not erase background
"My Window", WS_POPUP| WS_VISIBLE |WS_OVERLAPPEDWINDOW, CRect(100,100,500,500),this, 0);
创建子窗口:
wnd->CreateEx(NULL,AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW , NULL,
(HBRUSH) ::GetStockObject(WHITE_BRUSH),NULL), //if pass null, do not erase background
"My Window", WS_CHILD| WS_VISIBLE, CRect(100,100,500,500),this, 0);
创建浮动窗口,能够自行刷新:
子窗口不刷新: