1. Drawing messages
WM_PAINT-the window processing function is sent when the window needs to be drawn.
Situations where repainting is required:
(1) window from creation to first display
(2) from being obscured to re-displaying
(3) The window becomes larger (the window becomes the hour, the window itself does not need to be re-cs_hredraw, but if the registration window class is added | Cs_vredraw style, will be redrawn)
(4) Call the InvalidateRect function
Invalid window area-declared as an area that needs to be redrawn.
BOOL InvalidateRect (HWND hwnd,//Window handle
CONST rect* LpRect,//rectangle coordinates of the area
BOOL bErase); Whether to erase before re-return
In the program, if you need to draw the window, call the Function declaration window invalid area.
WPARAM-Do not use
LPARAM-Do not use
Message processing steps
(1) Start drawing processing
HDC BeginPaint (HWND hwnd,//drawing window
Lppaintstruct lppaint); Buffer for drawing parameters
Returns the drawing device handle HDC
(2) Drawing
(3) Finish drawing
BOOL EndPaint (HWND hwnd,//drawing window
CONST paintstruct *lppaint); Pointers to drawing parameters
2. Keyboard messages
Wm_keydown-generated when the key is pressed
Wm_keyup-generated when the button is released
Wm_syskeydown-generated when the system key is pressed, such as ALT, F10
Wm_syskeyup-generated when System key is released
WM_CHAR-Character message (TranslateMessage sent)
Message parameters:
Key message: WPARAM-Key Virtual key
LPARAM-key parameters, such as the number of presses
WM_CHAR message:
WPARAM-Input character (ASC character encoding)
LPARAM-Parameters related to keys
9.windows message Mechanism (iv)