Window class

xiaoxiao2021-03-06  43

Each window class has a window procedure related to its related window, the role of the window process is to process window messages, thereby controlling the behavior and appearance of the window. You must register the window class before creating a window. Registration window classes will enable window processes, customs, and other class properties to associate with a specific class name. Call

The CREATEWINDOW or CREATEWINDOWEX function specifies the class name, and the system will create a window according to the corresponding window procedure, class style, and class properties. There are three types of window classes: 1. System window 2. Application Global window class 3. Application partial window class

These three types of window classes differ in the way, registration, and destruction. The system window class is registered by Windows, some can be used by all the processes, while the other is called inside the system. Registration of the system window: Windows 95/98 / me: Register when the system is started. Windows NT / 2000 / XP: Register when the Windows Graphic Device Interface (GDI) is called for a thread.

All processes can be used in all processes: 1.Button 2.ComboBox 3.edit 4.Listbox 5.mdiclient 6.scrollbar 7.Static Applications Global window class is made by executable or dynamic link library (DLL) Register and can be used by other modules within the process.

Application for the Global Window Class: Windows NT / 2000 / XP: Create an application global window class in the DLL and load it in all processes. The method of loading the DLL is as follows:

Under the registry: key_local_machine / software / microsoft / windows nt / currentversion / windows branch, add the DLL file name to Appinit_DLLS

The value. Windows will load the DLL before entering the new process when starting a new process. The DLL must register the window class during the initialization process, and in the window style

Specify CS_GLOBALCLASS. Log out of this window class to use the UnregisterClass function.

Application Local Window Class is registered by executable or dynamic link library (DLL), but can only be used by the application, although you can register multiple applications local window classes,

Just register only one, the window class supports the window of the application main window.

When registering the module of the application partial window class is turned off, Windows destroys its registered window classes, or you can use the unregisterClass function to cancel it.

How do Windows find window classes?

1. Find the application partial window class, if not found 2. Find the application global window class, if not found 3. Find the system window class

You can override the system window category without affecting other applications, this is, you can create a local window class with the same name as the system window class, which will make the current should

Use the program to use the application partial window class, while other programs are not affected.

转载请注明原文地址:https://www.9cbs.com/read-71501.html

New Post(0)