找回密码
 加入
搜索
查看: 1448|回复: 3

请教我的脚本问题

[复制链接]
发表于 2008-9-2 21:34:58 | 显示全部楼层 |阅读模式
脚本如下:

#Include <GuiMenu.au3>
HotKeySet("!1", "ShowMessage")  ;Alt-1

while 1
WEnd

Func ShowMessage()
    Local $hWnd, $hMain, $hFile
    $text = WinGetTitle("")
    $hWnd = WinGetHandle($text)
        $hMain = _GUICtrlMenu_GetMenu($hWnd)
        $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)       
        $sText=_GUICtrlMenu_GetItemText($hFile, 2)
        MsgBox(0,"nihi11",$Text)
        MsgBox(0,"nihi",$sText)
        Run("Notepad.exe")
        Writeln("Open item text: " & _GUICtrlMenu_GetItemText($hFile, 2))
        _GUICtrlMenu_SetItemText($hFile, 1, "&Closed")
        Writeln("Open item text: " & _GUICtrlMenu_GetItemText($hFile, 1))
EndFunc
    Func Writeln($sText)
        ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR)
EndFunc   ;==>Writeln


问题:
1.Writeln($sText)函数没有执行,应如何修改?
2.MsgBox(0,"nihi11",$Text)以及MsgBox(0,"nihi",$sText)在记事本中可执行,但是在excel表中不执行,应如何修改?

我是初学者,请各位多多指教!

[ 本帖最后由 jchang 于 2008-9-4 22:10 编辑 ]
 楼主| 发表于 2008-9-4 12:17:36 | 显示全部楼层
难道就没人回复吗,难道问题不值得回答!!
发表于 2008-9-4 20:07:44 | 显示全部楼层
1,  Run("Notepad.exe")下面加一行:WinWaitActive("无标题")
2,excel为非标准菜单控件,属于工具条一类的
 楼主| 发表于 2008-9-4 20:51:29 | 显示全部楼层
多谢指教,对于初学者,你的回复是我们继续学习的最大动力
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-12 18:28 , Processed in 0.069598 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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