0

I am trying to create a borderless window with the standard shadow. I read on the winapi documentation that setting pMarInset with negative values to the DwmExtendFrameIntoClientArea function, creates the "sheet of glass" effect where the client area is rendered without a window border. This gives me the result I wanted, which is a borderless window with the standard shadow. However, when I resize the window, I can see the standard frame behind the solid background color I gave in the WNDCLASS struct. I tried clearing the screen with a solid color but I get some weird results:

This is the window when active:

enter image description here

And when the window is inactive:

enter image description here

When I hover over the app icon in the taskbar, I see the solid color I tried clearing the screen with:

enter image description here

Here is my window procedure:

case WM_PAINT: {
  PAINTSTRUCT ps;
  HDC hdc = BeginPaint(handle, &ps);
  FillRect(hdc, &ps.rcPaint, (HBRUSH)(COLOR_HIGHLIGHT+1));
  EndPaint(handle, &ps);
  return 0;
} break;
case WM_ACTIVATE: {
  MARGINS margins = {-1};
  DwmExtendFrameIntoClientArea(handle, &margins);
  return 0;
} break;
case WM_NCCALCSIZE: {
  if(wparam){ return 0; }
  return DefWindowProcA(handle, message, wparam, lparam);
} break;
nico.user
  • 483
  • 2
  • 5
  • 15

0 Answers0