Explorar el Código

Move HighContrastActive. Want to use it for SysLink later: its UseVisualStyle=False looks nice, but not when high contrast is active. And want to use it for the style test: dont think styling should be allowed when high contrast is active. Even though styling then still works, it would surely just annoy the end user?

Martijn Laan hace 2 semanas
padre
commit
7d8f019926
Se han modificado 2 ficheros con 10 adiciones y 10 borrados
  1. 0 10
      Projects/Src/IDE.HelperFunc.pas
  2. 10 0
      Projects/Src/Shared.CommonFunc.pas

+ 0 - 10
Projects/Src/IDE.HelperFunc.pas

@@ -81,7 +81,6 @@ function ReadScriptLines(const ALines: TStringList; const ReadFromFile: Boolean;
 function CreateBitmapInfo(const Width, Height, BitCount: Integer): TBitmapInfo;
 function CreateBitmapInfo(const Width, Height, BitCount: Integer): TBitmapInfo;
 function GetPreferredMemoFont: String;
 function GetPreferredMemoFont: String;
 function DoubleAmp(const S: String): String;
 function DoubleAmp(const S: String): String;
-function HighContrastActive: Boolean;
 
 
 implementation
 implementation
 
 
@@ -915,15 +914,6 @@ begin
   end;
   end;
 end;
 end;
 
 
-function HighContrastActive: Boolean;
-begin
-  var HighContrast: THighContrast;
-  HighContrast.cbSize := SizeOf(HighContrast);
-  Result := False;
-  if SystemParametersInfo(SPI_GETHIGHCONTRAST, HighContrast.cbSize, @HighContrast, 0) then
-    Result := (HighContrast.dwFlags and HCF_HIGHCONTRASTON) <> 0;
-end;
-
 initialization
 initialization
   var OSVersionInfo: TOSVersionInfo;
   var OSVersionInfo: TOSVersionInfo;
   OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
   OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);

+ 10 - 0
Projects/Src/Shared.CommonFunc.pas

@@ -150,6 +150,7 @@ procedure WaitMessageWithTimeout(const Milliseconds: DWORD);
 function MoveFileReplace(const ExistingFileName, NewFileName: String): Boolean;
 function MoveFileReplace(const ExistingFileName, NewFileName: String): Boolean;
 procedure TryEnableAutoCompleteFileSystem(Wnd: HWND);
 procedure TryEnableAutoCompleteFileSystem(Wnd: HWND);
 procedure CreateMutex(const MutexName: String);
 procedure CreateMutex(const MutexName: String);
+function HighContrastActive: Boolean;
 
 
 implementation
 implementation
 
 
@@ -1577,6 +1578,15 @@ begin
   Windows.CreateMutex(@SecurityAttr, False, PChar(MutexName));
   Windows.CreateMutex(@SecurityAttr, False, PChar(MutexName));
 end;
 end;
 
 
+function HighContrastActive: Boolean;
+begin
+  var HighContrast: THighContrast;
+  HighContrast.cbSize := SizeOf(HighContrast);
+  Result := False;
+  if SystemParametersInfo(SPI_GETHIGHCONTRAST, HighContrast.cbSize, @HighContrast, 0) then
+    Result := (HighContrast.dwFlags and HCF_HIGHCONTRASTON) <> 0;
+end;
+
 { TOneShotTimer }
 { TOneShotTimer }
 
 
 function TOneShotTimer.Expired: Boolean;
 function TOneShotTimer.Expired: Boolean;