WM_PAINT message
1 WM_PAINT A WM_PAINT message is generated due to the window's mutual coverage, and so on, resulting in areas that need to be drawn. In general, do not send WM_PAINT messages directly, through API declaration need to draw area to produce
WM_PAINT message
For example, you can use InvalidateRect to declare a region that needs to be redrawn
BOOL InvalidateRect ( hwnd hwnd, //Handle to Window lpRect , Rectangle coordinates BOOL bErase //Erase state);
2 wm_paint points of attention2.1 If there is more than one WM_PAINT message in a message queue, only the last message has a role2.2 WM_PAINT message processing, empty the area that needs to be drawn. Use of BeginPaint3 WM_PAINT3.1 WM_PAINT must be called at the beginning BeginPaint3.2 Wm_paint must be called at the end of the EndPaint
Keyboard messages
1 keyboard messages
Key message
Wm_keydown occurs when the key is pressed
Wm_keyup Occurs when a key is released
Wm_syskeydown (ALT/F10) occurs when the system key is pressed
Wm_syskeyup occurs when the System key is released
Character message
Wm_char occurs when a character key is pressed
TranslateMessage will convert the keys that can be displayed in the WM_KEYDOWN message into WM_CHAR messages
2 Message Parameters
WPARAM-Virtual Key code
LPARAM-related key information
3 Use of messages
3.1 When there is a key message, first enter the system message queue and then be retrieved by the program's message loop
3.2 Handling of messages
4 Order of keyboard messages
For the characters that can be displayed: Wm_keydown wm_char wm_keyup
For non-display characters: Wm_keydown wm_keyup
For system keys: Wm_syskeydown Wm_keyup
If the key has not been released, it will repeat
Wm_keydown (Wm_keychar)