


Detailed introduction to keyboard and mouse messages in Win32 SDK Basics (13)
1. Keyboard messages
1. Keyboard messages
WM_KEYDOWN - generated when a keyboard key is pressed.
WM_KEYUP - generated when the keyboard key pops up.
WM_SYSKEYDOWN —— Generated when the system key is pressed, such as ALT, F10, etc.
WM_SYSKEUP —— Generated when the system is released
WM_CHAR —— Character message
2. Message parameters:
Key message:
WPARAM - VirtualKey of the key
LPARAM - Key parameters, such as the number of times pressed
WM_CHAR:
WPARAM - Input characters (ASCII encoding)
LPARAM ——Relevant parameters of the button
3. Use of messages:
(1) KEYDOWN can repeat the message, KEYUP can only appear once when the key is released
(2) When TranslateMessage converts the WM_KEYDOWN message, WM_CHAR can be generated for visible characters, but there is no such message for invisible characters.
2. Mouse messages
1. Basic mouse messages
WM_LBUTTONDOWN——The left mouse button is pressed
WM_LBUTTONUP —— The left mouse button bounces up
WM_RBUTTONDOWN ——The right mouse button is pressed
WM_RBUTTONUP — — Right mouse button pops up
WM_MOUSEMOVE ——Mouse move message
1.1 Message parameters
WMPARAM ——The state of other keys, such as Ctrl/Shift, etc.
##LPARAM ——The position of the mouse, the window client area Coordinate System.
LOWORD X coordinate position
HIWORD Y coordinate position
1.2 Use of mouse messagesGenerally, mouse press/move up appears in pairs. During mouse movement, a series of WM_MOUSEMOVE messages will be generated according to the movement speed.
2. Double-click the messageWM_LBUTTONDBLICLK——Double-click the left mouse button
WM_RBUTTONDBLICLK——Double-click the right mouse button
WMPARAM ——The status of other keys, such as Ctrl/Shift, etc.
LPARAM ——Mouse The position, the coordinate system of the window client area.
LOWORD X coordinate position
HIWORD Y coordinate position
You need to be in the registration window when using it When adding the CS_DBLCLS style to the class, the order of message generation:
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_LBUTTONUP
3. Wheel messageWM_MOUSEWHEEL——Mouse wheel message
3.1 Message ParameterWMPARAM —— The status of other buttons
HIWORD —— The offset of the scroll wheel, which is a multiple of 120, through the positive and negative poles Indicates the direction of scrolling.
Positive: scroll forward
Negative: scroll backward
LRARAM: Mouse current Position, screen coordinate system:
LOWORD X coordinate position
HIWORD Y coordinate position
The above is the detailed content of Detailed introduction to keyboard and mouse messages in Win32 SDK Basics (13). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool