四海皆狂龙 发表于 2009-8-10 22:57:16

是否可以让命令行在窗口中运行

不知道能不能让CMD命令执行在自己定义的窗口中显示执行?

netegg 发表于 2009-8-11 01:07:38

曾经见过,似乎可以模拟一下

四海皆狂龙 发表于 2009-8-11 03:46:18

也就是潜入到自己用AUTOIT创建的窗体中,不知道要怎么写?能提供下代码吗?

Ziya 发表于 2009-8-11 13:23:30

这个我也很感兴趣,同等高手

四海皆狂龙 发表于 2009-8-11 15:12:06

等待中......怎么高手们都藏起来了。

l4ever 发表于 2009-8-11 17:20:28

本帖最后由 l4ever 于 2009-8-11 17:30 编辑

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("我的CMD", 700, 430)
$i1 = GUICtrlCreateInput("", 5, 5, 300, 20)
$b1 = GUICtrlCreateButton("Run", 315, 5, 50, 20)
$cmd = GUICtrlCreateEdit("cmd result is here" & @CRLF, 0, 30, 700, 400)
GUISetState(@SW_SHOW)


While 1
      $msg = GUIGetMsg()
      Select
                        Case $msg = $GUI_EVENT_CLOSE
                        Exit
                Case $msg = $b1
                        $command = GUICtrlRead($i1)
                        cmdping($command)
                       
EndSelect
WEnd
Func cmdPing($var)
        $vara = $var&">"&@TempDir&"\"&"Temp.txt"
        RunWait(@ComSpec & ' /c "'&$vara&'"',"", @SW_HIDE)
        $text = FileRead(@tempdir&"\Temp.txt")
        GUICtrlSetData ($cmd,$text)
        FileDelete(@tempdir&"\Temp.txt")
EndFunc

四海皆狂龙 发表于 2009-8-11 18:02:23

#include
$Form1 = GUICreate("我的CMD", 700, 430)
$i1 = GUICtrlCreateInput("", 5, 5, 300, 20)
$b1 = GUICtrlCreateButton("Run", 315, 5, 50, 20)
$cmd = GUICtrlCreateEdit("cmd result is here" & @CRLF ...
l4ever 发表于 2009-8-11 17:20 http://www.autoitx.com/images/common/back.gif
谢谢了!
这似乎是模拟的。不知道能不能真正内嵌。
我的目的是实时查看命令行程序打包的进度,但不希望在通常命令行中看到。如果使用上面的方法,仅仅是打包后的结果,这并不是我需要的。

clshuai 发表于 2009-9-3 20:22:51

请查看此贴,希望能帮助你或给你启发
http://www.autoitx.com/forum.php?mod=viewthread&tid=4185

menfan 发表于 2009-9-6 11:47:13

很多实例可以搜索到哦

xiaozui 发表于 2009-9-8 09:38:39

:face (25):学习中。。。
页: [1]
查看完整版本: 是否可以让命令行在窗口中运行