1. Registration of window classes
The simplest of the A.windows program is to create a simple window, and the window program is created based on the window class, and the window class determines the process function that processes the window message.
B. A window class can be used to create multiple windows, which means that the window is an instance object of the window class.
C. All button Windows-including the push button, check box, and radio box-are created based on the window class. Window classes Define window procedures and some other features for these windows.
D. When defining a window, we also need to define some additional properties that are specific to that window.
Create a window (that is, create an instance of a class), first you have to register a class, Windows has registerclass to register the window class, this function only needs a pointer to Wndclass (window class) of the structure of pointers to do parameters. The structure contains two pointers to strings. (Note: Because this wndclass field has two string pointers, there are different definitions for different encodings, namely wide-byte Unicode, narrow-byte Ascill, There are two different definitions in the header file WINUSER.H, Wndclassa and WNDCLASSW, which define Wndclassa and WNDCLASSW as WNDCLASS according to different coding methods after defining both methods.
The WNDCALSS wndclass is defined in the program, then the fields of the read wndclass are initialized, and the RegisterClass () is registered at the last call.
In all fields of WNDCLASS the group is important for the second field and the last field, and the second field (LPFNWNDPROC) is the address of the window procedure function that is based on all windows of that window class. The last field is the name of the window class, and the style field can be combined with a bitwise OR (|) operation with two-style identifiers.
One of the series of learning and thinking about Windows programs