This commit is contained in:
DavidXanatos 2022-02-05 17:53:41 +01:00
parent 5237592b34
commit ac8a2caf25
2 changed files with 17 additions and 8 deletions

View File

@ -33,7 +33,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed issue with box context menu in tray list [1106](https://github.com/sandboxie-plus/Sandboxie/issues/1106)
- fixed issue with "AutoExec=..."
- fixed issues canceling box deletion operations didn't working [1061](https://github.com/sandboxie-plus/Sandboxie/issues/1061)
- fixed issue with DPI scalling and color picker dialog [#803](https://github.com/sandboxie-plus/Sandboxie/issues/803)

View File

@ -78,6 +78,14 @@ typedef struct _WND_HOOK {
} WND_HOOK;
#ifndef _DPI_AWARENESS_CONTEXTS_
struct DPI_AWARENESS_CONTEXT__ { int unused; };
typedef DPI_AWARENESS_CONTEXT__ *DPI_AWARENESS_CONTEXT;
#endif
typedef DPI_AWARENESS_CONTEXT (WINAPI *P_SetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext);
typedef BOOL (WINAPI *P_SetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT value);
//---------------------------------------------------------------------------
// Variables
//---------------------------------------------------------------------------
@ -85,14 +93,8 @@ typedef struct _WND_HOOK {
static HWND DDE_Request_ProxyWnd = NULL;
#ifndef _DPI_AWARENESS_CONTEXTS_
struct DPI_AWARENESS_CONTEXT__ { int unused; };
typedef DPI_AWARENESS_CONTEXT__ *DPI_AWARENESS_CONTEXT;
#endif
typedef DPI_AWARENESS_CONTEXT (WINAPI *P_SetThreadDpiAwarenessContext)(
DPI_AWARENESS_CONTEXT dpiContext);
static P_SetThreadDpiAwarenessContext __sys_SetThreadDpiAwarenessContext = NULL;
static P_SetProcessDpiAwarenessContext __sys_SetProcessDpiAwarenessContext = NULL;
//---------------------------------------------------------------------------
// Constructor
@ -124,6 +126,9 @@ GuiServer::GuiServer()
__sys_SetThreadDpiAwarenessContext = (P_SetThreadDpiAwarenessContext)GetProcAddress(
GetModuleHandle(L"user32.dll"), "SetThreadDpiAwarenessContext");
__sys_SetProcessDpiAwarenessContext = (P_SetProcessDpiAwarenessContext)GetProcAddress(
GetModuleHandle(L"user32.dll"), "SetProcessDpiAwarenessContext");
}
@ -567,6 +572,10 @@ void GuiServer::RunSlave(const WCHAR *cmdline)
GuiServer *pThis = GetInstance();
if (__sys_SetProcessDpiAwarenessContext) {
__sys_SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
}
//
// get process id for parent (which should be the main SbieSvc process)
//