Tutorial by Examples

A WM_CREATE message is sent to your window procedure during the window's CreateWindowEx call. The lp argument contains a pointer to a CREATESTRUCT which contains the arguments passed to CreateWindowEx. If an application returns 0 from WM_CREATE, the window is created. If an application returns -1, ...
This message is sent to your window procedure when a window is being destroyed. It is sent after the window is removed from the screen. Most applications free any resources, like memory or handles, obtained in WM_CREATE. If you handle this message, return 0. LRESULT CALLBACK winproc(HWND hwnd, UINT...
Sent when an application's close button is clicked. Do not confuse this with WM_DESTROY which is sent when a window will be destroyed. The main difference lies in the fact that closing may be canceled in WM_CLOSE (think of Microsoft Word asking to save your changes), versus that destroying is when t...
This message is sent to the window's window procedure after it's size has changed. The most common reason for handling this message is to adjust the position of any child windows. For example, in Notepad, when the window is resized the child window (edit control) is also resized. Return 0 if you han...
Sent to a window procedure when: the user selects an item from a menu a control sends a notification to its parent window an accelerator keystroke is translated Message SourceHIWORD(wp)LOWORD(wp)lpMenu0Menu ID (IDM_*)0Accelerator1Accel ID (IDM_*)0Controlnotification codeControl idHWND of con...

Page 1 of 1