本帖最后由 lixiaolong 于 2012-6-30 23:32 编辑
Vista,Win7 有效,Win8没测试.
#RequireAdmin
Global $WIN95 = "WIN95" ; Windows 95
Global $WIN98 = "WIN98" ;Windows 98 / Windows Me
Global $NT4SP5 = "NT4SP5" ;Windows NT 4.0(Service Pack 5)
Global $WIN2000 = "WIN2000" ;Windows 2000
Global $WINXPSP2 = "WINXPSP2" ;Windows XP(Service Pack 2)
Global $WINXPSP3 = "WINXPSP3" ;Windows XP(Service Pack 3)
Global $WINSRV03SP1 = "WINSRV03SP1" ;Windows Server 2003(Service Pack 1)
Global $WINSRV08SP1 = "WINSRV08SP1" ;Windows Server 2008(Service Pack 1)
Global $VISTARTM = "VISTARTM" ;Windows Vista
Global $VISTASP1 = "VISTASP1" ;Windows Vista(Service Pack 1)
Global $VISTASP2 = "VISTASP2" ;Windows Vista(Service Pack 2)
CompatibilityMode("C:\Program Files\Tencent\QQ\Bin\QQ.exe", $WINXPSP3)
;~ CompatibilityMode("C:\Program Files\Tencent\QQ\Bin\QQ.exe") ; Default
Run("C:\Program Files\Tencent\QQ\Bin\QQ.exe")
Func CompatibilityMode($Program, $Mode = "")
Local $RedKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
If Not $Mode Then
RegDelete($RedKey, $Program)
Else
$a = RegWrite($RedKey, $Program, "REG_SZ", $Mode)
;~ MsgBox(0, '', $a)
EndIf
EndFunc ;==>CompatibilityMode
|