WM_PAINT and WM_CREATE
I am still very new to Win32 API, and the tutorials that I have dont tell me what the Difference between
WM_PAINT and WM_CREATE is!
Can someone tell me that, like what goes to the one and what goes into the other as examples?
Thanks in advance !:D
WM_CREATE is called once when the window or dialog is created. It is in response to a CreateWindow() or CreateDialog() call. This means it must be called by the app.
WM_PAINT is called everytime the app needs to update the screen. It can be called by windows or by the app.
It should contain as little code as possible (BeginPaint() and EndPaint() are required)
Also WM_CREATE happens when the app starts and only when it starts. WM_PAINT happens when it has to redraw the screen. For example restoring it from the minimazatrion or drapping a window over it.
WM_CREATE is there so you can perform one time operations like you might create an edit control here and give it initial text.
WM_PAINT is sent to your window whenever you need to update part of the client area, such as when it has just been minimised or uncovered from another window.
Thanks everybody that helped a lot!