1. Keyboard message 1. Keyboard message WM_KEYDOWN - generated when a keyboard key is pressed. WM_KEYUP - generated when a 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 (virtual key code) LPARAM - - Parameters of the button, such as the number of times pressed WM_CHAR:WPARAM - Input characters (ASCII encoding) LPARAM - Related parameters of the button 3. Use of messages: (1) KEYDOWN can repeat the message, KEYUP can only be released after the button is released Appears once (2) TranslateMessage When converting 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 - WM_LBUTTONUP when the left mouse button is pressed
1. Win32 SDK Basics (13) Detailed introduction to keyboard and mouse messages
Introduction: 1. Keyboard message 1. Keyboard message WM_KEYDOWN - generated when a keyboard key is pressed. WM_KEYUP - generated when a 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 (virtual key code) LPARAM -
2. Win32 SDK Basics (Twelve) Processing of WM_PAINT Message (Figure)
Introduction: 1. Introduction In a computer, almost everything displayed on the screen is drawn, including windows, dialog boxes, pictures, and all text, and the WM_PAINT message is Messages triggered by the system when drawing these objects. Almost every operation we perform on the computer will trigger this message, and it is also one of the most important messages in WIndows. This article focuses on experimenting with this message for a comprehensive study. 2. Basics of WM_PAINT 2.1 Macro definition #define WM_PAIN
Introduction: 1. Message Queue 1.1 Message Queue Message queue is a queue used to store messages. Messages are stored in the queue In first-in-first-out mode, all window programs have message queues, and the program can obtain messages from the queue. 1.2 Types of message queues System message queue: A message queue maintained by the operating system, which stores messages generated by the system, such as mouse and keyboard messages, etc. Program message queue: a message queue belonging to each application (thread), maintained by the application.
4. Win32 SDK Basics (10) Detailed explanation of several common Windows message processing sample codes
Introduction: An introduction This article mainly introduces the processing of several common Windows messages. In "Win32 SDK Basics (8) - Windows Message Mechanism", we introduced For the processing of WM_CREATE message, before the window is created, we use the message processing function to pop up a MessageBox. Based on this, this article introduces other common Windows messages such as WM_DESTROY, WM_SYSCOMMAND, WM_QUIT, WM_SIZE and so on. First, we introduce the summary of Windows common messages in
Introduction: 1. Windows message distribution message range description 0 ~ WM_USER – 1 system message WM_USER ~ 0x7FFF custom window class integer message WM_APP ~ 0xBFFF application custom message 0xC000 ~
6. Win32 SDK Basics (8) Detailed explanation of Windows message mechanism (picture)
Introduction: 1. What is a message? Before explaining what a message is, let us first discuss the execution mechanism of the program. Generally speaking, programs can be divided into two categories according to their execution mechanisms: the first category is process-driven. For example, the C program we wrote when we first came into contact with programming, or the microcontroller program. This type of program often has a pre-set execution process, and when we execute it, we just execute it step by step; the second type is event-driven. I believe everyone can understand this incident. The occurrence of each event is random, and each event will have its own moment, similar to events in life.
7 in the program. Win32 SDK Basics (7) Example of how to create a sub-window of a window
Introduction: What is a child window? When we click a button in a Windows window, such as clicking the close button of the window, a window will often pop up to prompt relevant information. A pop-up window like this is a sub-window of the main window. When we create a child window, we also use the CreateWindow or CreateWindowEx API. Let’s take a look at the function prototype of CreateWindow: HWND WINAPI CreateWindow(_In_opt_ LPCTSTR
8. Win32 SDK Basics (6) Detailed explanation of the window class search process and related API
Introduction: 1. The search process of window classes In the previous article, we introduced the three window classes of the windows system ——System window class, global window class and local window class. Each window class has a different scope in the operating system, and the window class name registered in each scope cannot be repeated when creating a window. , global and local scopes are searched according to the window class name. The search process is summarized as follows: (1) The operating system searches in the local window class according to the incoming window class name. If it is found, execute step 2. If it is not found, execute step 2. 3 steps. (2
9. Win32 SDK Basics (5) A brief introduction to the window class
##Introduction: 1. Introduction In the previous article, we created a window from scratch. One of the most important steps is to register the window class, such as the following code. ://Register window class BOOL Register(LPSTR lpClassName, WNDPROC wndProc){ WNDCLASSEX wce = { 0 }; wce.cbSize = sizeof(wce); wce.cbClsExtra =
10. Win32 SDK Basics (4) The second step of how to create a windows window from scratch
Introduction: 3.5 Display window. After creating the window, if we want to see the window when running, we also need to explicitly set the display window: ShowWindow(hWnd, SW_SHOW);UpdateWindow(hWnd); ShowWindow and UpdateWindow are both system API, the former is to set the display properties of the window. The latter is to re-update the window properties. Only after the update, the properties will take effect. Our WinMain.
The above is the detailed content of Detailed introduction to the basics of SDK. For more information, please follow other related articles on the PHP Chinese website!