In progress: This page is still being researched. I’ll be adding more info as I go. But there’s already some value so enjoy if you’re into this stuff…

The goal is to replace the Windows own window chrome / non-client area / border while maintaining compatibility with layout snapping features in both Windows 10 and Windows 11.

Introduction to the chore

Following steps are generally involved:

  1. Create window with the right window flags.
  2. Call DwmExtendFrameIntoClientArea that extends the client area for DWM.
  3. Implement handler for WM_NCCALCSIZE that extends the client area for Win32.
    1. This is also requires us to tell the OS that we are going to change the chrome when window is created by calling ShowWindowPos from WM_CREATE.
  4. Implement handler for WM_HITTEST to inform Windows where your own chrome controls are.
  5. Implement message handlers for mouse to handle the controls interaction.
  6. Work around random parts of either Windows 95 or Windows 7 portions of the chrome being rendered.

Nearly every step mentioned above has it’s own parameters and annoyances and they do affect each other in some cases. Here are some known correlations:

Known regressions

The goal is to ideally not have any of following known regressions happening. (This is list a result of my own manual testing, and there might be more things I simply don’t know about.)