Custom Window Class
Windows subsystem defines many built-in classes for creating different windows. Custom window class should be defined by user. User can use WNDCLASS or WNDCLASSEX structure to define a custom class. User can define different attributes of an window class along with the name of the class. This class then should be registered for further use in the program. CreateWindow and CreateWindowEx takes this name as an argument and creates the window handle.
WNDCLASS: The WNDCLASS structure contains the window class attributes that are registered by the RegisterClass() function.
WNDCLASSEX: The WNDCLASSEX structure contains the window class attributes that are registered by the RegisterClassEx() function.
RegisterClass: The RegisterClass() function registers a window class for subsequent use in calls to the CreateWindow() or CreateWindowEx() function.
RegisterClassEx: The RegisterClassEx() function registers a window class for subsequent use in calls to the CreateWindow() or CreateWindowEx() function.
CreateWindow: The CreateWindow function takes the name of the class which is registered by the RegisterClass function.
CreateWindowEx: The CreateWindowEx function takes the name of the class which is registered by the RegisterClass/RegisterClassEx function. This function is primarily used for the extended window class with extended styles etc.
About our authors: Team EQA
MFC hides WinMain in its framework and includes source file on WinMain(). This explains how framework calls global CWinApp::Initinstance() from entry WinMain.
This is constructed during global C++ objects are constructed and is already available when Windows calls the WinMain function, which is supplied by the ...
Define a custom Window class structure, Register the class name, CreateWindow, Show windows and write message get and dispatch loop statements. Define the Window CallBack procedure and write the handlers.
DispatchMessage() is a API which indirectly triggers the Window CallBack procedure. Message structure members from this function are passed to the CallBack procedure. CallBack procedure should implement event handlers depending on the need of the application.
LPARAM and WPARAM are the two parameters in Window CallBack procedure. They signifies parameters of various events. They are used in handing individual events.
We need to write WinMain and need to follow all these in a Win32 application. However we need not to write much if we are writing an application with MFC ...
Questions index C Questions C++ Questions Win32 MFC COM/DCOM DLL Questions
Compilers & Editors
Download Visual Studio Download XCode Download Visual Studio Code Android studio install sdk Eclipse installer Best C compilers IDEs
Development system setup
Windows media creation tool MSDN subscription Ubuntu virtualbox
New updated posts
Why learn C? Calculate weighted average