今天意外发现替一哥们做的程序还有漏洞,点击弹出来的对话框的BUTTON时,发现主窗口(实际是VIEW啦)不自动重绘以产生相应图形。我就纳闷了,我明明已经给VIEW类发送WM_PAINT重绘消息了啊,怎么回事?搜索MSDN,发现以下一段话:
The WM_PAINT message is generated by the system and should not be sent by an application . To force a window to draw into a specific device context, use the WM_PRINT or WM_PRINTCLIENT message.
Note that this requires the target window to support the WM_PRINTCLIENT message. Most common controls support the WM_PRINTCLIENT message. The DefWindowProc function validates the update region. The function may also send the WM_NCPAINT message to the window procedure if the window frame must be painted and send the WM_ERASEBKGND message if the window background must be erased.
The system sends this message when there are no other messages in the application's message queue. DispatchMessage determines where to send the message; GetMessage determine