Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 12:38:37 +0000



Post From: Can SC sponsor or collab to have a Custom Window Skin to fix detached window borders ?

[2024-09-03 02:26:06]
seandunaway - Posts: 268
will you make your attached files public so i can see what you mean?

does this work?

#include <dwmapi.h>
#include <sierrachart.h>

SCDLLName("darkmode")

SCSFExport scsf_darkmode(SCStudyInterfaceRef sc) {
  if (sc.SetDefaults) {
    sc.DisplayStudyName = 0;
    sc.GraphName = "darkmode";
    sc.GraphRegion = 0;
    return;
  }

  BOOL darkmode = TRUE;
  int& initialized = sc.GetPersistentIntFast(0);

  if (sc.LastCallToFunction) {
    darkmode = FALSE;
    initialized = 0;
  }

  if (initialized) return;

  HWND hwnd = sc.GetChartWindowHandle(sc.ChartNumber);
  DwmSetWindowAttribute(hwnd, 19, &darkmode, sizeof(darkmode));
  DwmSetWindowAttribute(hwnd, 20, &darkmode, sizeof(darkmode));

  sc.AddMessageToLog(darkmode ? "enabled" : "disabled", 0);
  initialized = 1;
}

Date Time Of Last Edit: 2024-09-03 03:19:49
imagedarkmode.png / V - Attached On 2024-09-03 02:25:49 UTC - Size: 72.42 KB - 44 views
attachmentdarkmode_64.dll - Attached On 2024-09-03 02:25:53 UTC - Size: 89.5 KB - 67 views
attachmentdarkmode_arm64.dll - Attached On 2024-09-03 02:25:56 UTC - Size: 78 KB - 87 views