lp010437 发表于 2010-5-21 17:07:19

如何生成一个带有说明文字和按钮窗口的EXE文件?

本帖最后由 lp010437 于 2010-5-24 09:52 编辑

我分别作出了两个脚本,想把这两个脚本合并成一个,编译成的EXE文件界面有说明文字和按钮操作,不知道怎么办,哪位大侠帮忙看看?本人初学,不要笑话偶。
源码如下:
1、
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

        FileInstall("E:\programming\Reg2Au3\patch.exe",@TempDir&"\")
$Form1 = GUICreate("patch", 250, 80, 400, 300)
$Button1 = GUICtrlCreateButton("安装", 45, 19, 75, 35)
$Button2 = GUICtrlCreateButton("取消", 135, 19, 75, 35)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run(@TempDir&"\patch.exe")
MsgBox(0,"成功","安装成功!")
Case $Button2
MsgBox(0,"提示","您取消了安装!")
FileDelete(@TempDir&"\patch.exe")
Exit
EndSwitch
WEnd

2、
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("patch", 200, 200, 400, 400)
$Label1 = GUICtrlCreateLabel("本程序要和BD权限设置工具配合使用。仅供测试使用,不得用于商业用途,请在测试后及时删除,作者不承担任何法律责任。", 26, 50, 155, 89)
$Group1 = GUICtrlCreateGroup("说明", 15, 20, 165, 120)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

                Case $Label1
        EndSwitch
WEnd

lanfengc 发表于 2010-5-21 17:45:23

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

FileInstall("E:\programming\Reg2Au3\patch.exe",@TempDir&"\")
$Form1 = GUICreate("patch", 200, 200, 400, 400)
$Label1 = GUICtrlCreateLabel("本程序要和BD权限设置工具配合使用。仅供测试使用,不得用于商业用途,请在测试后及时删除,作者不承担任何法律责任。", 26, 50, 155, 89)
$Group1 = GUICtrlCreateGroup("说明", 15, 20, 165, 120)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$Button1 = GUICtrlCreateButton("安装", 15, 159, 75, 35)
$Button2 = GUICtrlCreateButton("取消", 105, 159, 75, 35)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run(@TempDir&"\patch.exe")
MsgBox(0,"成功","安装成功!")
Case $Button2
MsgBox(0,"提示","您取消了安装!")
FileDelete(@TempDir&"\patch.exe")
Exit
EndSwitch
WEnd

lp010437 发表于 2010-5-24 09:51:46

谢谢,已经解决。
页: [1]
查看完整版本: 如何生成一个带有说明文字和按钮窗口的EXE文件?