In Windows, the word "window" has a definite meaning. A window is a rectangular area on the screen. It receives user input and Displays output content in text or graphic format.
The message window contains a title column with a close button, an option icon, one or more lines of text, and a maximum of four buttons.
Creating a window is simple. You only need to call the CreateWindow function.
Function Example 3-1
- The LoadIcon loading icon is used by the program.
- LoadCursor loads the mouse cursor for the program to use.
- GetStockObject gets a graphic object (in this example, it is a painting object that gets the drawing window background ).
- RegisterClass is the type of the registration window in the program window.
- The message box is displayed in MessageBox.
- CreateWindow creates a window based on the window type.
- The ShowWindow is displayed on the screen.
- UpdateWindow indicates that the window is self-updated.
- GetMessage obtains a message from the message queue.
- TranslateMessage translates some keyboard messages.
- DispatchMessage sends the message to the window message processing program.
- PlaySound plays a sound file.
- BeginPaint starts to draw the window.
- GetClientRect obtains the size of the area displayed in the window.
- The DrawText string.
- EndPaint ends the painting window.
- PostQuitMessage inserts an Exit message in the message queue.
- DefWindowProc executes the specified message processing.