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

请问如何实现这样的功能??~

[复制链接]
发表于 2009-4-30 17:37:59 | 显示全部楼层 |阅读模式
本帖最后由 king0000 于 2009-5-1 12:55 编辑

AU3窗口代码如下:
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 292, 108, 192, 124)
$Input1 = GUICtrlCreateInput("", 64, 32, 137, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
要实现的目标是:当检测到记事本运行,则窗口$Form1中的框$Input1中会显示[运行正常];如果没有检测到记事本运行,则显示[没有运行]。

请问应该在上面代码中添加怎样的语句可以实现这样的功能。

感谢高人赐教。
发表于 2009-4-30 21:06:59 | 显示全部楼层
AU3窗口代码如下:
#include
#include
#include
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 292, 108, 192, 124)
$Input1 = GUICtrlCreateInput("", 64, 32, 137, 21)
GU ...
king0000 发表于 2009-4-30 17:37


楼主很懒,仅仅就设计了个可视化窗口~~~
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 292, 108, 192, 124)
$Input1 = GUICtrlCreateInput("", 64, 32, 137, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
        $Txt=GUICtrlRead($Input1)
        If ProcessExists("notepad.exe") Then
                If $Txt<>"运行正常" Then
                        GUICtrlSetData($Input1,"运行正常")
                EndIf
        Else
                If $Txt<>"记事本未运行" Then
                        GUICtrlSetData($Input1,"记事本未运行")
                EndIf
        EndIf
WEnd
 楼主| 发表于 2009-5-1 12:55:56 | 显示全部楼层
十分感谢~~~!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 22:03 , Processed in 0.076798 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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