找回密码
 加入
搜索
查看: 3258|回复: 7

[GUI管理] 更新编辑框Edit数据问题

  [复制链接]
发表于 2010-6-18 11:36:37 | 显示全部楼层 |阅读模式
GUICtrlSetData()函数在更新edit 的数据我想直接在原来的数据后面接着插入,不覆盖掉原来的内容,请问该怎么弄?
发表于 2010-6-18 11:58:20 | 显示全部楼层
GUICtrlSetData ( 控件ID, 数据, ' ') 第三个参数非空即可,一个空格都行,只要不是 ''
 楼主| 发表于 2010-6-18 13:52:54 | 显示全部楼层
本帖最后由 lsh127k 于 2010-6-18 16:03 编辑

我是要提取cmd运行后的回显,然后在编辑框中显示,希望能和cmd中直接运行命令的效果相似,但是当回显很长的时候,会从中间某个地方开始后面的就不会显示了。回显较少的时候是没问题的。比如运行ping。
Func Chklogo()
        Local $foo,$line,$lines
        GUICtrlSetData($display," ")
        $chklogoDir = GUICtrlRead($chklogo)
        $foo = Run(@ComSpec & " /c "&$chklogoDir&" /mda", @WindowsDir, @SW_HIDE, $STDOUT_CHILD)
        ;$foo = Run(@ComSpec & " /c ping -n 10 127.0.0.1", @WindowsDir, @SW_HIDE, $STDOUT_CHILD)
        $lines = ""
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
        If $line = "" Or $line = " " Then
                ContinueLoop
        EndIf
     $lines = $line
         GUICtrlSetData($display, $lines, " ")
         ;MsgBox(0,"", $line)
 Wend
 ;MsgBox(0,"", $lines)
 ;ConsoleWrite($lines)
EndFunc
发表于 2010-6-18 14:31:10 | 显示全部楼层
不太明白,标记一下
发表于 2010-6-18 14:36:39 | 显示全部楼层
回复 3# lsh127k


    那是另外一个问题 GUICtrlSetLimit ($display, 1000000000000)
 楼主| 发表于 2010-6-18 15:44:35 | 显示全部楼层
本帖最后由 lsh127k 于 2010-6-18 16:02 编辑

不是,如果我先用一个变量吧所有的回显都存起来,然后在写到edit里面是可以全部显示的。注意14,15行
Func Chklogo()
        Local $foo,$line,$lines
        GUICtrlSetData($display," ")
        $chklogoDir = GUICtrlRead($chklogo)
        $foo = Run(@ComSpec & " /c "&$chklogoDir&" /mda", @WindowsDir, @SW_HIDE, $STDOUT_CHILD)
        ;$foo = Run(@ComSpec & " /c ping -n 10 127.0.0.1", @WindowsDir, @SW_HIDE, $STDOUT_CHILD)
        $lines = ""
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
        If $line = "" Or $line = " " Then
                ContinueLoop
        EndIf
     $lines &= $line
         GUICtrlSetData($display, $lines)
         ;MsgBox(0,"", $line)
 Wend
 ;MsgBox(0,"", $lines)
 ;ConsoleWrite($lines)
EndFunc
发表于 2010-6-18 16:02:46 | 显示全部楼层
那就不是edit的问题,是回显问题。而且你这个代码cpu占用一定很高……
 楼主| 发表于 2010-6-18 16:13:22 | 显示全部楼层
我看了$line , 和 $lines 回显都抓到了,就是edit前面能有数据出来,但是到中间的某个时候他里面的数据就不在更新了,但是$line中会抓到数据。
另外不知道有没有其他的抓取回显的方法?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-2 01:12 , Processed in 0.093875 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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