


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Windows 11’s native apps (like File Explorer) and other shell apps use rounded corners and Fluent Design elements (like Acrylic) by default. In addition to rounded corners, another important design feature of Windows 11 is materials like mica, which aligns the background color of apps with the desktop. Mica is similar to acrylic but works slightly differently. As Microsoft describes it, Windows Mica Materials creates "color hierarchy by aligning backgrounds with apps

Antivirus software may sometimes display a warning stating Trojan/win11.casdet rfn on Windows 32 laptops. It indicates that the PC is infected with Trojan malware, causing it to malfunction. Fortunately, there are some possible ways to fix this problem, as explained below. Additionally, you may be interested in our detailed guide on whether cdn.districtm.io is a pop-up/virus/malware or not. What is Trojan/win32.casdet rfn? Trojan/win32.casdet rfn is a severe Trojan virus infection that can overrun the system and kill its processes, making it easy

The difference between win32 and win64 is: 1. win32 refers to the 32-bit environment of the Microsoft Windows operating system, and win64 refers to the 64-bit version of the Microsoft Windows operating system, which is more stable and faster than the 32-bit version; 2. win32 supports up to 2G of memory. win64 must have more than 4G of memory; 3. win64 supports 64-bit processors, but win32 cannot fully support it; 4. win32 pursues simplicity, while win64 pursues performance.

Back in August 2021, Microsoft promised that OneNote on Windows 10 and Windows 11 would receive a series of major feature updates in the coming months, as the tech giant unifies multiple versions of the note-taking app into a single one. part of the efforts of customers. OneNote has undergone many changes over the past few years. In 2018, when Microsoft really wanted people to use its UWP version of OneNote, the company stopped bundling the original and feature-rich version of OneNote with preinstalled Office apps. Instead, Microsoft has only provided a UWP client and added new features for modern versions. Microsoft later changed

A Microsoft official confirmed widespread reports that Google Chrome, ChromiumEdge, Discord and several other applications were flagged as "Behavior:Win32/Hive.ZY" by Microsoft's built-in antivirus software "WindowsDefender". The tech giant confirmed in a statement that it is working on a fix that will be rolled out to everyone in the next few hours. So what exactly is "Behavior:Win32/Hive.ZY"? According to a document posted on Microsoft's security portal, any file marked "Behavior:Win32/Hive.ZY" is

Microsoft is putting a lot of new features into the Microsoft Store. These will benefit both end users and developers as the company continues its efforts to make the Store better for everyone who uses Windows. One of the biggest highlights of these changes will be the new "Restore Apps" feature in Microsoft Store on Windows 11. It will be connected to the user's Microsoft account, so after logging into a new Windows 11 PC, they can automatically restore the application with just a few clicks. "To make it easier for customers to quickly and seamlessly transition to their new PCs, we will soon be introducing

Many Windows 11 and 10 users are troubled by seeing warning notifications from Windows Defender stating that the threat "Behavior: Win32/Hive.ZY" has been detected. According to reports, this Windows Defender warning or alert is triggered when users try to open some commonly used applications such as Google Chrome or Chromium Edge, Whatsapp, Discord, and Spotify. Even if you have blocked this threat on your PC, it will pop up with a message MicrosoftDefenderAntivi the next time you open this affected application

According to recent news, Canva has launched a series of AI image tool functions in an attempt to compete with Adobe's Firefly. It aims to simplify the content creation process in the workplace, making it easier and more efficient for non-design professionals to create content, and allowing graphic designers to Focus on mission-critical tasks and challenge Adobe's dominance in the market. According to reports, Canva’s Visual Worksuite has integrated the new BrandHub, which aims to provide users with a set of tools to help them ensure consistency with their organization’s visual identity. Users can use this tool to create a BrandKit (brand IP toolkit) that contains company cultural information (such as LOGO, fonts, colors and unified design style).
