诺言 发表于 2011-6-5 01:41:27

这个代码应该怎么写

#include <GUIConstantsEx.au3>
GUICreate("测试", 200, 200)
GUICtrlCreateButton("点击这里以后", 10, 10, 180, 50)
GUICtrlCreateEdit("", 10, 70, 180, 100)
GUICtrlSetData(-1, "这里改变为设定的内容")
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

xiaozui 发表于 2011-6-5 01:56:45

这是不是你想要的效果?#include <GUIConstantsEx.au3>
GUICreate("测试", 200, 200)
$Button=GUICtrlCreateButton("点击这里以后", 10, 10, 180, 50)
$Edit=GUICtrlCreateEdit("", 10, 70, 180, 100)
GUISetState(@SW_SHOW)
While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button
             GUICtrlSetData($Edit, "这里的内容已经更改了哦")
      EndSwitch
WEnd

诺言 发表于 2011-6-5 02:00:45

是的 谢谢 啊

诺言 发表于 2011-6-5 02:09:59

#NoTrayIcon
#include <Process.au3>
$Config=IniRead("映像名称.TXT","映像名称","映像名称","QQ.EXE")
While 1
$Process=ProcessExists($Config)
If $Process=0 Then
ProcessWait($Config)
Else
ProcessClose($Config)
EndIf
ContinueLoop
WEnd这样只能监控一个映像名称,如果想监控多个应该怎么写呢?

xiaozui 发表于 2011-6-5 11:27:27

这样只能监控一个映像名称,如果想监控多个应该怎么写呢?
诺言 发表于 2011-6-5 02:09 http://www.autoitx.com/images/common/back.gif

试试这个。#NoTrayIcon
#include <Process.au3>
While 1
$Config = IniReadSection("映像名称.ini","映像名称")
If @error Then
    MsgBox(16, "错误", "啊哦, 读取INI文件失败.")
        ExitLoop
Else
    For $i = 1 To $Config
      If ProcessExists($Config[$i]) Then
                        ProcessClose($Config[$i])
          EndIf
        Sleep(100)
    Next
EndIf
WEnd顺便提醒一下, IniRead是从某标准配置文件(*.ini)中读取某个数值,你用来读取.txt文件,貌似不规范哦

inter701 发表于 2011-6-5 13:01:44

good~good~
页: [1]
查看完整版本: 这个代码应该怎么写