Skip to content

Commit

Permalink
support some modern UI on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Feb 16, 2024
1 parent e64940e commit 8919419
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vstgui/standalone/source/platform/win32/win32window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,15 @@ bool Window::init (const WindowConfiguration& config, IWindowDelegate& inDelegat
delegate = &inDelegate;
SetWindowLongPtr (hwnd, GWLP_USERDATA, (__int3264) (LONG_PTR)this);
if (style.hasBorder ())
{
hasMenu = true;
BOOL value = TRUE;
DwmSetWindowAttribute (hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof (value));
}
if (style.isTransparent ())
makeTransparent ();
dwStyle = GetWindowStyle (hwnd);

return true;
}

Expand Down Expand Up @@ -459,6 +464,8 @@ void Window::makeTransparent ()
MARGINS margin = {-1};
auto res = DwmExtendFrameIntoClientArea (hwnd, &margin);
vstgui_assert (res == S_OK);
DWM_SYSTEMBACKDROP_TYPE type = DWMSBT_NONE;
res = DwmSetWindowAttribute (hwnd, DWMWA_SYSTEMBACKDROP_TYPE, &type, sizeof (type));
}

//------------------------------------------------------------------------
Expand Down

0 comments on commit 8919419

Please sign in to comment.