Hi to all,
I have a problem with redraw (or handle redraw message) with a win32 window in C++.
I open a normal (WS_OVERLAPPEDWINDOW) window and I handle the messages with a standard code.
My goal is to move a simple sketch (a rectangle painted with FillRect() ) with drag the mouse.
For this reason, I handle the WM_MOUSEMOVE message. When I obtain a WM_MOUSEMOVE, I get the X and Y coords, update the position of my rectangle and redraw it (I tried with two methosd: call redrawWindows() or redraw directly the rectangle in WM_MOUSEMOVE method, between GetDC() and ReleaseDC() ).
This works quite well only that after a few seconds of dragging the mouse, the drawing of the window no longer occurs. The client area remains white and I can no longer see my rectangle.
I cannot understand the reason for this behavior.
Do you have any suggestions on why and how to solve the problem?
Thank you all.