找回密码
 加入
搜索
查看: 1574|回复: 2

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

[复制链接]
发表于 2010-5-21 17:07:19 | 显示全部楼层 |阅读模式
本帖最后由 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
发表于 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
 楼主| 发表于 2010-5-24 09:51:46 | 显示全部楼层
谢谢,已经解决。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 07:19 , Processed in 0.077989 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表