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
WNDCLASS: The WNDCLASS structure contains the window class attributes that are registered by the RegisterClass() function.
WNDCLASSEX
WNDCLASSEX: The WNDCLASSEX structure contains the window class attributes that are registered by the RegisterClassEx() function.
RegisterClass
RegisterClass: The RegisterClass() function registers a window class for subsequent use in calls to the CreateWindow() or CreateWindowEx() function.
RegisterClassEx
RegisterClassEx: The RegisterClassEx() function registers a window class for subsequent use in calls to the CreateWindow() or CreateWindowEx() function.
CreateWindow
CreateWindow: The CreateWindow function takes the name of the class which is registered by the RegisterClass function.
CreateWindowEx
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.
Example Code:
About our authors: Team EQA
Further readings
What is WinMain function in windows C? Main vs WinMain, WinMain prototype and arguments.
Describes What is WinMain()? Entry point funtion in Windows exe. Function prototype. Implementation, Command line argument passing. Show Window flag.
Steps to write a basic window program with C and Win32 APIs.
Include windows.h, Define WinMain, Define WNDCLASS attributes, RegisterClass, CreateWindow, ShowWindow, UpdateWindow, GetMessage, DispatchMessage, DefWindowProc
What are LPARAM and WPARAM in window proc function ? How Win32 subsystem pass parameters to this function?
Explains the parameters WPARAM and LPARAM and in window procedure function. What is this W and L stands for? How Win32 subsystem pass parameters?
What is WM_PAINT event ? When does Win32 subsystem call WM_PAINT event?
All you wanted to know Drawing in Windows, Paint Event WM_PAINT, Device Context, BeginPaint EndPaint GDI Objects, Pen, Brush, Font, Bitmap, Palette, Region.