Messages When Creating Windows

When a window is created, Windows automatically sends messages to the application's WndProc function. Most of these messages are passed to the DefWindowProc. By default, an application's WndProc should send messages that are not handled by the application to the DefWindowProc. This allows Windows to do most of the hard work and lets the application deal with only the messages it needs to.

When the CreateWindow function creates the main application window, five messages are sent to the application's WndProc function. The WndProc function normally processes the WM_CREATE message, while passing the other four messages to the DefWindowProc. The application uses the WM_CREATE message when initializing the window. The ...

Get Microsoft Windows 2000 API SuperBible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.