Skip to content

Commit

Permalink
Set system tray DPI awareness on Win10/11
Browse files Browse the repository at this point in the history
  • Loading branch information
Falcosoft committed Oct 16, 2023
1 parent 6ccaff2 commit c6e47be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions driver/MidiSynth.cpp
Expand Up @@ -1138,9 +1138,9 @@ namespace VSTMIDIDRV{
vstDriver = NULL;
return 1;
}

vstDriver->initSysTray();

vstDriver->setHighDpiMode(GetHighDpiMode());
vstDriver->initSysTray();
InitDialog(uDeviceID);

framesRendered = 0;
Expand Down
2 changes: 2 additions & 0 deletions vsthost/vsthost.cpp
Expand Up @@ -1175,6 +1175,8 @@ static unsigned __stdcall TrayThread(void* threadparam)
windowClass.lpfnWndProc = TrayWndProc;
windowClass.lpszClassName = L"VSTHostUtilWindow";

if (SetThreadDpiAwarenessContext) SetThreadDpiAwarenessContext((HANDLE) -2); //System aware

RegisterClass(&windowClass);
trayWndHandle = CreateWindowEx(WS_EX_TOOLWINDOW, windowClass.lpszClassName, L"VSTTray", WS_POPUP, 0, 0, 0, 0, 0, 0, GetModuleHandle(NULL), NULL);

Expand Down

0 comments on commit c6e47be

Please sign in to comment.