Windows Handles (窗口句柄)
The Windows Operating system uses “handles” to refer to components of windows
HANDLE:
This is a Windows.h type and typedef void* HANDLE(address)
It stores the handle of a Window...
GetStdHandle:
Is a Windows.h function, that returns the handle to a standard device, such as standard input, standard output, or standard error.
In this case: STD_OUTPUT_HANDLE
To move the cursor position:
To set the colour of the text to be printed
SetConsoleTextAttribute takes in two arguments, the handle to the window, and an integer representing the colour to set the text foreground and background
Windows Programming
Creating a Win32 Project:
“Win32 Project”: The entrypoint for this program will be the WinMain function..
The simplest Windows program
The Static Control
The WM_CREATEmessage is sent upon window creation.
It can be used to setup the window’s contents.
Controls are also known as “Widgets”
Here, CreateWindowis used to make a static control.
Static Controls are used to display text (and graphics).
They cannot be interacted with... no selection, no keyboard focus
The Button Control
Receiving Button Click Messages
The Check Box Control
The Edit Control
Window Menus