One of the series of learning and thinking about Windows programs

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.