WinWorkstation.st
branchexpecco_19_2_0
changeset 8906 ac2bce3f4f42
parent 8901 33323151f56a
child 8907 4dba092535cc
--- a/WinWorkstation.st	Tue Nov 26 16:57:44 2019 +0100
+++ b/WinWorkstation.st	Thu Nov 28 13:16:54 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 COPYRIGHT (c) 1996 by Claus Gittinger
 	      All Rights Reserved
@@ -9,6 +11,8 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
+'From Smalltalk/X, Version:7.2.0.0 on 28-11-2019 at 13:15:50'                   !
+
 "{ Package: 'stx:libview' }"
 
 "{ NameSpace: Smalltalk }"
@@ -2142,7 +2146,7 @@
                     }
                     goto again;
                 }
-                /* fail evtl. später ändern und in st verzögert aufrufen
+                /* fail evtl. später ändern und in st verzögert aufrufen
                 */
                 console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
             }
@@ -6696,6 +6700,49 @@
 
 !WinWorkstation class methodsFor:'queries'!
 
+isHighDpiAware
+    "answers if this app is high dpi aware"
+
+    "
+        Screen isHighDpiAware.     
+    "       
+
+    |isHighDpiAware|
+
+    isHighDpiAware := false.
+
+%{
+        HINSTANCE hShcore = LoadLibrary("Shcore.dll");
+
+        if (hShcore) {
+            static HRESULT (__stdcall *P_GetProcessDpiAwareness)(HANDLE, VOID*);
+            P_GetProcessDpiAwareness = (HRESULT (__stdcall *)(HANDLE, VOID*))GetProcAddress(hShcore, "GetProcessDpiAwareness");
+
+            if (P_GetProcessDpiAwareness) {
+                UINT processDpiAwarness = 0;
+
+                if ((*P_GetProcessDpiAwareness)(NULL, &processDpiAwarness) == S_OK) {
+                    if (processDpiAwarness == 0) {
+                        isHighDpiAware = false;   
+                    } else {
+                        isHighDpiAware = true;      
+                    }
+                } else {
+                    printf("Call \"GetProcessDpiAwareness()\" failed\n");
+                };      
+            } else {
+                printf("Loading \"GetProcessDpiAwareness()\" failed\n");
+            }
+        } else {
+            printf("Loading \"Shcore.dll\" failed\n");
+        }
+%}.
+
+    ^ isHighDpiAware
+
+    "Created: / 27-11-2019 / 13:40:04 / Stefan Reise"
+!
+
 isWindowsPlatform
     "return true, if this device is a windows screen"
 
@@ -6859,8 +6906,7 @@
             P_GetScaleFactorForMonitor = (HRESULT (__stdcall *)(HMONITOR, VOID*))GetProcAddress(hShcore, "GetScaleFactorForMonitor");
 
             if (P_GetScaleFactorForMonitor) {
-                UINT displayScaleFactor;
-
+                UINT displayScaleFactor = 0;
 
                 if ((*P_GetScaleFactorForMonitor)(hMonitor, &displayScaleFactor) == S_OK) {
                     scaleFactor = __MKSMALLINT(displayScaleFactor);
@@ -6886,7 +6932,7 @@
     ^ scaleFactor / 100
 
     "Created: / 25-11-2019 / 11:52:42 / Stefan Reise"
-    "Modified: / 26-11-2019 / 16:43:02 / Stefan Reise"
+    "Modified: / 26-11-2019 / 16:43:29 / Stefan Reise"
 !
 
 thisAppVirtualResolutionByMonitorDeviceName:aMonitorDeviceName
@@ -20540,7 +20586,7 @@
     }
 %}
     "
-     (StandardSystemView new label:'äöü') open
+     (StandardSystemView new label:'äöü') open
     "
 !