View Full Version : RedrawWindow

Lex Dean
01-30-2016, 02:25 PM
Please excuse me but I'm, a delphi programer drying to do C++ stuff you could say
The reason I'm doing all this is the Delphi paint procedures cannot be accessed or over ridden
so I have to make a separate procedure of my own, The objective is remove flicker from the WM_ERASEBKGND message
And that means not to use WM_Paint in my case as that locks in a WM_ERASEBKGND message.

Reading MS web site RedrawWindow https://msdn.microsoft.com/en-us/library/windows/desktop/dd162911(v=vs.85).aspx

I do not understand lprcUpdate [in] A pointer to a RECT structure containing the coordinates, in device units, of the update rectangle.
Is this based on the screen coordinates, form coordinates or what?

hrgnUpdate [in] A handle to the update region. I have a DC, A HWND or handle, I have TopLeft form coordinates to the area I want to paint
How does one get a hrgnUpdate

I want to use RDW_NOERASE to stop any WM_ERASEBKGND message
I want use the RDW_NOINTERNALPAINT and same procedure to do the painting and not use a WM_Paint messages
Dose RDW_INVALIDATE give me the right to paint on my canvas

Simon Arbon
01-30-2016, 03:49 PM
The easiest thing to do is to add a message handler for WM_ERASEBKGND to the window and return Message.Result := 1 to prevent windows from clearing the window.
The 5th post in this topic has a complete example of using forms with OpenGL: