The Old New Thing

Which window style bits belong to whom?

There are 64 bits of styles in the parameters to CreateWindowEx. Which ones belong to whom? Windows defines the meanings of the high word of the dwStyle parameter and all of the bits in the dwExStyle parameter. The low 16 bits of the dwStyle parameter are defined by the implementor of the window class (by the person who calls RegisterClass...

Which message numbers belong to whom?

Valid window messages break down into four categories. 0 .. 0x3FF (WM_USER-1): System-defined messages. The meanings of these messages are defined by the operating system and cannot be changed. Do not invent new messages here. Since the meanings are defined by Windows, the operating system understands how to parse the WPARAM and LPARAM ...

What are these strange values returned from GWLP_WNDPROC?

GetWindowLongPtr(hwnd, GWLP_WNDPROC) [or GetWindowLong(hwnd, GWL_WNDPROC) if you haven't yet made your code 64-bit compatible] is supposed to return the current window procedure. Why do I sometimes get wacko values? Because sometimes "you can't handle the truth". If the current window procedure is incompatible with the caller of ...