search
HomeOperation and MaintenanceWindows Operation and MaintenanceDetailed 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 messages

Generally, 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 message

WM_LBUTTONDBLICLK——Double-click the left mouse button

WM_RBUTTONDBLICLK——Double-click the right mouse button

2.1 Message parameters

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 message

WM_MOUSEWHEEL——Mouse wheel message

3.1 Message Parameter

WMPARAM —— 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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SecLists

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

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool