Search the Community
Showing results for tags 'Compability'.
-
#include <FileConstants.au3> #include <MsgBoxConstants.au3> #Region AppCompatFlags Constants ;~ HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers ;~ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers ; #CONSTANTS# =================================================================================================================== ; Privilege level value Global Const $__sACF_RUNASADMIN = 'RUNASADMIN' ; Run this program as an Administrator ; Settings value Global Const $__sACF_HIGHDPIWARE = 'HIGHDPIWARE' ; Disable display scaling on high DPI settings Global Const $__sACF_256COLOR = '256COLOR' ; Reduce color mode (8-bit 256) Global Const $__sACF_16BITCOLOR = '16BITCOLOR' ; Reduce color mode (16-bit 65536) Global Const $__sACF_640X480 = '640X480' ; Run in 640 x 480 screen resolution Global Const $__sACF_PLACEHOLDERFILES = 'PLACEHOLDERFILES' ; Enable this program to work on SkyDrive files ; Compatibility mode value Global Const $__sACF_WIN95 = 'WIN95' ; Windows 95 Global Const $__sACF_WIN98 = 'WIN98' ; Windows 98 / Windows ME Global Const $__sACF_WINXPSP2 = 'WINXPSP2' ; Windows XP (Service Pack 2) Global Const $__sACF_WINXPSP3 = 'WINXPSP3' ; Windows XP (Service Pack 3) Global Const $__sACF_VISTARTM = 'VISTARTM' ; Windows Vista Global Const $__sACF_VISTASP1 = 'VISTASP1' ; Windows Vista (Service Pack 1) Global Const $__sACF_VISTASP2 = 'VISTASP2' ; Windows Vista (Service Pack 2) Global Const $__sACF_WIN7RTM = 'WIN7RTM' ; Windows 7 Global Const $__sACF_WIN8RTM = 'WIN8RTM' ; Windows 8 Global Const $__sACF_WINSRV08SP1 = 'WINSRV08SP1' ; Windows Server 2008 SP1 Global Const $__sACF_REGEXP_Compability = '(WIN95|WIN98|WINXPSP2|WINXPSP3|VISTARTM|VISTASP1|VISTASP2|WIN7RTM|WIN8RTM|WINSRV08SP1)' #Region EXAMPLE Func Example() MsgBox($MB_SYSTEMMODAL, 'TEST', '_IsProgramInCompabilityMode() = ' & _IsProgramInCompabilityMode(@AutoItExe)) MsgBox($MB_SYSTEMMODAL, 'TEST', '_IsProgramRunWithSetting() = ' & _ _IsProgramRunWithSetting( _ FileOpenDialog('Chose file to test', '', 'Program (*.exe)', $FD_FILEMUSTEXIST), _ $__sACF_RUNASADMIN) _ ) EndFunc ;==>Example #EndRegion EXAMPLE #Region CURRENT Func _IsProgramInCompabilityMode($sFileFullPath) Local $sRegKey = 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' Local $sValue For $i = 1 To 1000 $sValueName = RegEnumVal($sRegKey, $i) If @error <> 0 Then ExitLoop If $sFileFullPath = $sValueName Then If StringRegExp(RegRead($sRegKey, $sValueName), $__sACF_REGEXP_Compability) Then Return True EndIf EndIf Next Return False EndFunc ;==>_IsProgramInCompabilityMode Func _IsProgramRunWithSetting($sFileFullPath, $sSetting) Local $sRegKey = 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' Local $sValue For $i = 1 To 1000 $sValueName = RegEnumVal($sRegKey, $i) If @error <> 0 Then ExitLoop If $sFileFullPath = $sValueName Then If StringInStr(RegRead($sRegKey, $sValueName), $sSetting) Then Return True EndIf EndIf Next Return False EndFunc ;==>_IsProgramRunWithSetting #EndRegion CURRENT HOWTO: Example() ps. Not finished jet.