Author Topic: Theme BricsCAD's titlebar  (Read 284 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Theme BricsCAD's titlebar
« on: November 02, 2022, 05:59:11 PM »
Theme BricsCAD's titlebar  :crazy2:

DwmSetWindowAttribute is in newer versions of windows 10, so this may not work for you if you don't update often.

Code - C: [Select]
  1.  static void CTest_themetitle()
  2.     {
  3.         try
  4.         {
  5.             resbuf menubar;
  6.             menubar.restype = RTSHORT;
  7.             menubar.resval.rint = 0;
  8.             acedSetVar(_T("MENUBAR"), &menubar);
  9.             constexpr DWORD DWMWA_USE_IMMERSIVE_DARK_MODE_I20 = 20;
  10.             BOOL USE_DARK_MODE = true;
  11.             BOOL SET_IMMERSIVE_DARK_MODE_SUCCESS = SUCCEEDED(DwmSetWindowAttribute(
  12.                 adsw_acadMainWnd(), DWMWA_USE_IMMERSIVE_DARK_MODE_I20, &USE_DARK_MODE, sizeof(USE_DARK_MODE)));
  13.             const auto style = GetWindowLong(adsw_acadMainWnd(), GWL_STYLE);
  14.             SetWindowLong(adsw_acadMainWnd(), GWL_STYLE, 0);
  15.             SetWindowLong(adsw_acadMainWnd(), GWL_STYLE, style);
  16.         }
  17.         catch (...)
  18.         {
  19.             acutPrintf(_T("\nException: "));
  20.         }
  21.     }
  22.  
Retired