File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,16 @@ __fastcall TMainF::TMainF(TComponent* Owner)
243
243
void __fastcall TMainF::GUI_Configure ()
244
244
{
245
245
// Hard coded
246
- float DPIScale=static_cast <float >(GetSystemDpiForProcess (GetCurrentProcess ()))/96 ;
246
+ OSVERSIONINFO osvi;
247
+ ZeroMemory (&osvi, sizeof (OSVERSIONINFO));
248
+ osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
249
+ GetVersionEx (&osvi);
250
+ int DPI;
251
+ if (osvi.dwMajorVersion >= 10 && (osvi.dwMajorVersion > 10 || osvi.dwMinorVersion > 0 || osvi.dwBuildNumber >= 17134 ))
252
+ DPI=GetSystemDpiForProcess (GetCurrentProcess ());
253
+ else
254
+ DPI=GetDeviceCaps (GetDC (NULL ), LOGPIXELSX);
255
+ float DPIScale=static_cast <float >(DPI)/96 ;
247
256
float ScaledScreenWidth=Screen->Width /DPIScale;
248
257
float ScaledScreenHeight=Screen->Height /DPIScale;
249
258
Width=500 ;
You can’t perform that action at this time.
0 commit comments