找回密码
 加入
搜索
查看: 1616|回复: 5

类似开始菜单中的运行

[复制链接]
发表于 2008-11-13 17:10:28 | 显示全部楼层 |阅读模式
想做个维护工具 类似开始菜单中的运行 (平常网吧里的开始菜单中的运行是禁用的)
我刚开始学,谁帮我看看是哪写错了?!有没有更好的办法?

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

;定义
dim $tywl

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("天逸网络维护工具", 369, 157, 226, 181)
$Combo1 = GUICtrlCreateInput($tywl, 64, 72, 283,20)
$Button1 = GUICtrlCreateButton("确定", 96, 112, 75, 25, 0)
$Button2 = GUICtrlCreateButton("取消", 184, 112, 75, 25, 0)
$Button3 = GUICtrlCreateButton("浏览", 272, 112, 75, 25, 0)
$Label1 = GUICtrlCreateLabel(" 运行:", 16, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("[组策略:gpedit.msc].[启动项:msconfig].[注册表:regedit]", 16, 25, 324, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button2
                        Exit
                case $Button3
                        $open = open()
                case $Button1
                        $ad = ad()
        EndSwitch
WEnd

;浏览
Func open()
        AdlibDisable()
        $tywl = FileOpenDialog("浏览", @DesktopDir,"所有文件(*.*)")
        GUICtrlSetData($Combo1,$tywl)
EndFunc   

;确定
Func ad()
        AdlibDisable()
                        RunWait($tywl)
        Exit
EndFunc

[ 本帖最后由 zhuang513 于 2008-11-14 21:58 编辑 ]
 楼主| 发表于 2008-11-14 03:16:40 | 显示全部楼层
   没人能帮我吗??
发表于 2008-11-14 11:08:08 | 显示全部楼层
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

;定义
dim $tywl

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("天逸网络维护工具", 369, 157, 226, 181)
$Combo1 = GUICtrlCreateInput($tywl, 64, 72, 283,20)
$Button1 = GUICtrlCreateButton("确定", 96, 112, 75, 25, 0)
$Button2 = GUICtrlCreateButton("取消", 184, 112, 75, 25, 0)
$Button3 = GUICtrlCreateButton("浏览", 272, 112, 75, 25, 0)
$Label1 = GUICtrlCreateLabel(" 运行:", 16, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("[组策略:gpedit.msc].[启动项:msconfig].[注册表:regedit]", 16, 25, 324, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button2
                        Exit
                case $Button3
                        $open = open()
                case $Button1
                        $ad = ad()
        EndSwitch
WEnd

;浏览
Func open()
        AdlibDisable()
        $tywl = FileOpenDialog("浏览", @DesktopDir,"所有文件(*.*)")
        GUICtrlSetData($Combo1,$tywl)
EndFunc   

;确定
Func ad()
        AdlibDisable()
                $pro  = GUICtrlRead($Combo1)
                ShellExecute($pro)    ; 改成ShellExecuteWait可以等待程序运行结束
        Exit
EndFunc
发表于 2008-11-14 12:43:52 | 显示全部楼层
Send("#r")
WinWaitActive("")
发表于 2008-11-14 12:46:18 | 显示全部楼层
run("rundll32 shell32.dll #61")
 楼主| 发表于 2008-11-14 21:58:26 | 显示全部楼层
谢谢啊。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-10 08:20 , Processed in 0.078587 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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