Hi all,

im at iczelions Tutorial #6 right now and tried an alternative to InvalidateRect to force Windows sending WM_Paint. I tried

invoke UpdateWindow,hWin

but it didnt work...as soon as i change the size of the window it updates the client area and shows the letter typed last, so UpdateWindow seems not to send WM_PAINT in my case but why? The client area shouldn't be empty cause i already paint a letter there at startup.

i also tried

invoke SendMessage,hWin,WM_PAINT,0,0

but that didnt work either, so what am i doing wrong?
Posted on 2004-12-13 10:35:22 by LittleEndian

The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn


The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty. The function sends a WM_PAINT message directly to the window procedure of the specified window, bypassing the application queue. If the update region is empty, no message is sent.

As you've done nothing to mess with the update region, the UpdateWindow call does not send a WM_PAINT.

Posted on 2004-12-13 11:20:34 by Mirno
Thx Mirno, i read the definition of the update region and i think i understand now why UpdateWindow didn't work. Now theres only the question left why
invoke SendMessage,hWin,WM_PAINT,0,0
didnt work. Any background info on that function i may should know ?
Posted on 2004-12-13 13:43:15 by LittleEndian
Look up WM_PAINT in the PlatformSDK... under remarks, there's the following text:

The WM_PAINT message is generated by the system and should not be sent by an application.
Posted on 2004-12-13 13:46:45 by f0dder
All right! Thx F0dder!
Posted on 2004-12-13 15:14:11 by LittleEndian
I think I've read somewhere in iczellions tutes that you can use sendmessage if you want to talk to a child window.
Posted on 2005-02-09 23:35:21 by Phase Verocity
Thanks ,body......
Posted on 2005-06-07 00:27:36 by CPB