Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [bug report]problem about processing WM_PAINT message
[bug report]problem about processing WM_PAINT message [message #29734] |
Thu, 11 November 2010 07:59 |
jinshiyi11
Messages: 7 Registered: October 2010 Location: CHINA
|
Promising Member |
|
|
I think the processing about WM_PAINT message in Ctrl::WindowProc(...) has some issue.
Location at the "CtrlCore\Win32Proc.cpp" file(Ctrl::WindowProc)
LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
...
case WM_PAINT:
ASSERT(hwnd);
if(IsVisible() && hwnd) {
//drawing code
}
return 0L;
....
}
If ctrl is not visible,then drawing code will not be executed and just return 0L.At this scenario£¬WM_PAINT will not be removed from message queue.Then Ctrl::ProcessEvent(...) will process with WM_PAINT message again and again.
The Windows documentation notes that you can't use PeekMessage to remove WM_PAINT messages from the message queue.
The only way to remove a WM_PAINT message from the queue is to validate the invalid regions of the window's client area, which you can do with ValidateRect, ValidateRgn, or a BeginPaint and EndPaint pair.
I encounter this problem when I use ToolTip ctrl.The tooltip window received WM_PAINT message but it is unvisible sometimes.I don't konw why.
[Updated on: Thu, 11 November 2010 08:10] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 24 10:23:40 CEST 2024
Total time taken to generate the page: 0.01974 seconds
|