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

实现回车即可执行程序 实现回车即可执行程序实现回车即可执行程序

[复制链接]
发表于 2009-5-11 21:20:13 | 显示全部楼层 |阅读模式
实现回车即可执行程序
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\autoit3\Aut2Exe\Icons\exec.ico
#AutoIt3Wrapper_outfile=维护工具.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\cface\桌面\form1.kxf

Opt("TrayIconHide", 1)
$Form1 = GUICreate(" ->维护工具", 278, 215, 399, 154)
GUISetIcon("D:\autoit3\Aut2Exe\Icons\exec.ico")
$Button1 = GUICtrlCreateButton("录音调控", 16, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("声音调控", 16, 56, 75, 25, 0)
$Button3 = GUICtrlCreateButton("进程管理", 16, 104, 75, 25, 0)
$Button4 = GUICtrlCreateButton("控制面版", 104, 8, 75, 25, 0)
$Button5 = GUICtrlCreateButton("命令行", 104, 56, 75, 25, 0)
$Button6 = GUICtrlCreateButton("注册表", 104, 104, 75, 25, 0)
$Button7 = GUICtrlCreateButton("计算器", 192, 8, 75, 25, 0)
$Button8 = GUICtrlCreateButton("画图工具", 192, 56, 75, 25, 0)
$Button9 = GUICtrlCreateButton("测试网络", 192, 104, 75, 25, 0)
$Button10 = GUICtrlCreateButton("运行 ", 120, 144, 59, 25, 0)
$Button11 = GUICtrlCreateButton("时间日期", 192, 144, 75, 25, 0)
$input = GUICtrlCreateInput("", 16, 144, 97, 21)
$Label1 = GUICtrlCreateLabel("QQ:494249100  我们一直用心服务!", 40, 184, 217, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                                Case $Button1
                        _RunDOS(@SystemDir &"\sndrec32.exe");打开系统属性
                Case $Button2
                        _RunDOS(@SystemDir &"\sndvol32.exe");打开显示属性
                Case $Button3
                        Run(@SystemDir &"\taskmgr.exe");打开任务管理器        
                Case $Button4
                        Run(@SystemDir &"\control.exe");打开控制面板        
                Case $Button5
                        Run(@SystemDir &"\cmd.exe");打开命令行
                Case $Button6
                        Run(@WindowsDir &"\regedit.exe");打开注册表
                                               
                Case $Button7
                        Run("calc.exe");打开计算器
                Case $Button8
                        Run(@SystemDir &"\mspaint");打开音量控制程序
                Case $Button9
                        $rc = _RunDos("start ping 172.16.1.1 -t")
                          ;打开策略组  另一种写法Run(@ComSpec&' /c gpedit.msc',@SystemDir,@SW_HIDE)
               
                Case $Button10
                        Run(@ComSpec &" /c "&GUICtrlRead($input) );这里是这个作品的关键 读取文本框里的内容然后运行
                                               
                                                Send("{enter}")
               Case $Button11
                        _RunDOS(@SystemDir &"\timedate.cpl");打开时间日期
                Case $Label1
        EndSwitch
WEnd[quote]#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\autoit3\Aut2Exe\Icons\exec.ico
#AutoIt3Wrapper_outfile=维护工具.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\cface\桌面\form1.kxf

Opt("TrayIconHide", 1)
$Form1 = GUICreate(" ->维护工具", 278, 215, 399, 154)
GUISetIcon("D:\autoit3\Aut2Exe\Icons\exec.ico")
$Button1 = GUICtrlCreateButton("录音调控", 16, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("声音调控", 16, 56, 75, 25, 0)
$Button3 = GUICtrlCreateButton("进程管理", 16, 104, 75, 25, 0)
$Button4 = GUICtrlCreateButton("控制面版", 104, 8, 75, 25, 0)
$Button5 = GUICtrlCreateButton("命令行", 104, 56, 75, 25, 0)
$Button6 = GUICtrlCreateButton("注册表", 104, 104, 75, 25, 0)
$Button7 = GUICtrlCreateButton("计算器", 192, 8, 75, 25, 0)
$Button8 = GUICtrlCreateButton("画图工具", 192, 56, 75, 25, 0)
$Button9 = GUICtrlCreateButton("测试网络", 192, 104, 75, 25, 0)
$Button10 = GUICtrlCreateButton("运行 ", 120, 144, 59, 25, 0)
$Button11 = GUICtrlCreateButton("时间日期", 192, 144, 75, 25, 0)
$input = GUICtrlCreateInput("", 16, 144, 97, 21)
$Label1 = GUICtrlCreateLabel("QQ:494249100  我们一直用心服务!", 40, 184, 217, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                                Case $Button1
                        _RunDOS(@SystemDir &"\sndrec32.exe");打开系统属性
                Case $Button2
                        _RunDOS(@SystemDir &"\sndvol32.exe");打开显示属性
                Case $Button3
                        Run(@SystemDir &"\taskmgr.exe");打开任务管理器        
                Case $Button4
                        Run(@SystemDir &"\control.exe");打开控制面板        
                Case $Button5
                        Run(@SystemDir &"\cmd.exe");打开命令行
                Case $Button6
                        Run(@WindowsDir &"\regedit.exe");打开注册表
                                               
                Case $Button7
                        Run("calc.exe");打开计算器
                Case $Button8
                        Run(@SystemDir &"\mspaint");打开音量控制程序
                Case $Button9
                        $rc = _RunDos("start ping 172.16.1.1 -t")
                          ;打开策略组  另一种写法Run(@ComSpec&' /c gpedit.msc',@SystemDir,@SW_HIDE)
               
                Case $Button10
                        Run(@ComSpec &" /c "&GUICtrlRead($input) );这里是这个作品的关键 读取文本框里的内容然后运行
                                               
                                                Send("{enter}")
               Case $Button11
                        _RunDOS(@SystemDir &"\timedate.cpl");打开时间日期
                Case $Label1
        EndSwitch
WEnd




Button10 如何 实现回车即可执行程序
发表于 2009-5-11 22:32:46 | 显示全部楼层
1# manys518
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=D:\autoit3\Aut2Exe\Icons\exec.ico
#AutoIt3Wrapper_Outfile=维护工具.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\cface\桌面\form1.kxf

HotKeySet("{enter}","_run_command")
Opt("TrayIconHide", 1)
$Form1 = GUICreate(" ->维护工具", 278, 215, 399, 154)
GUISetIcon("D:\autoit3\Aut2Exe\Icons\exec.ico")
$Button1 = GUICtrlCreateButton("录音调控", 16, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("声音调控", 16, 56, 75, 25, 0)
$Button3 = GUICtrlCreateButton("进程管理", 16, 104, 75, 25, 0)
$Button4 = GUICtrlCreateButton("控制面版", 104, 8, 75, 25, 0)
$Button5 = GUICtrlCreateButton("命令行", 104, 56, 75, 25, 0)
$Button6 = GUICtrlCreateButton("注册表", 104, 104, 75, 25, 0)
$Button7 = GUICtrlCreateButton("计算器", 192, 8, 75, 25, 0)
$Button8 = GUICtrlCreateButton("画图工具", 192, 56, 75, 25, 0)
$Button9 = GUICtrlCreateButton("测试网络", 192, 104, 75, 25, 0)
$Button10 = GUICtrlCreateButton("运行 ", 120, 144, 59, 25, 0)
$Button11 = GUICtrlCreateButton("时间日期", 192, 144, 75, 25, 0)
$input = GUICtrlCreateInput("", 16, 144, 97, 21)
$Label1 = GUICtrlCreateLabel("QQ:494249100  我们一直用心服务!", 40, 184, 217, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        _RunDOS(@SystemDir & "\sndrec32.exe");打开系统属性
                Case $Button2
                        _RunDOS(@SystemDir & "\sndvol32.exe");打开显示属性
                Case $Button3
                        Run(@SystemDir & "\taskmgr.exe");打开任务管理器
                Case $Button4
                        Run(@SystemDir & "\control.exe");打开控制面板
                Case $Button5
                        Run(@SystemDir & "\cmd.exe");打开命令行
                Case $Button6
                        Run(@WindowsDir & "\regedit.exe");打开注册表

                Case $Button7
                        Run("calc.exe");打开计算器
                Case $Button8
                        Run(@SystemDir & "\mspaint");打开音量控制程序
                Case $Button9
                        $rc = _RunDOS("start ping 172.16.1.1 -t")
                        ;打开策略组  另一种写法Run(@ComSpec&' /c gpedit.msc',@SystemDir,@SW_HIDE)

                Case $Button10
                        _run_command()
                Case $Button11
                        _RunDOS(@SystemDir & "\timedate.cpl");打开时间日期
                Case $Label1
        EndSwitch
WEnd

Func _run_command()
        Run(@ComSpec & " /c " & GUICtrlRead($input));这里是这个作品的关键 读取文本框里的内容然后运行
EndFunc
发表于 2009-12-22 13:15:46 | 显示全部楼层
谢谢了!我收藏了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 15:27 , Processed in 0.074799 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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