#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("设置兼容性", 195, 53, 198, 124)
$Button1 = GUICtrlCreateButton("打开", 16, 16, 41, 25)
$Button2 = GUICtrlCreateButton("设置兼容性", 64, 16, 113, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$var = FileOpenDialog ("请选择需要设置兼容性的文件",@DesktopDir,"所有文件(*.*)")
If @error Then MsgBox(4096,"","没有选择文件!")
Case $Button2
$add = RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers",$var,"REG_SZ","WIN98")
If $add = 0 Then
MsgBox(0,"错误","添加出错,错误代码为:"&@error)
Else
MsgBox(0,"成功","兼容 Windows 98 模式设置成功!")
EndIf
EndSwitch
WEnd
不知道是不是我变笨了,越来越看不懂问题了....
点击"打开"按钮选择一个文件
点击"设置兼容性"按钮,会把该文件设置为win98兼容模式 |