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?
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?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_7ano.asp
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
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4zef.asp
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.
Mirno
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
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4zef.asp
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.
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 ?
invoke SendMessage,hWin,WM_PAINT,0,0
didnt work. Any background info on that function i may should know ?
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.
The WM_PAINT message is generated by the system and should not be sent by an application.
All right! Thx F0dder!
I think I've read somewhere in iczellions tutes that you can use sendmessage if you want to talk to a child window.
Thanks ,body......