|
本帖最后由 cashiba 于 2016-3-16 19:16 编辑
新手请教大神老师们:下面这段API自定义函数在AU3中有吗?没有的话怎么改变成AU3中可用的自定义函数呢?
Private Declare Function SendMessage Lib "user32" Alias "SendMessageW" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Func GetText(Arg_hwnd)
Dim S_TextLen
S_TextLen = SendMessage(Arg_hwnd, &HE, 0, 0)
S_strText = Space(S_TextLen)
Call SendMessage(Arg_hwnd, &HD, S_TextLen+1, S_strText)
GetText = S_strText
EndFunc
另外,下面这两个窗口函数在按键精灵中比较常用,可以层层递进得到子窗口或子控件的句柄
父句柄 = Plugin.Window.Find(窗口类名,窗口标题);根据窗口类名或标题返回窗口句柄
子句柄 = Plugin.Window.FindEx(父句柄, 0, 子类名, 0);根据父窗口句柄和子窗口(或控件)的类名得到子窗口或控件的句柄
在AU3中好像是分别对应于WinGetHandle及ControlGetHandle吧?
但直接改成AU3代码
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <GuiToolbar.au3>
#include <ScreenCapture.au3>
#include <GuiListView.au3>
Dim $biaoti,$H0,$H1,$H2
$biaoti="基本信息"
Opt("WinTitleMatchMode")
$H0= WinGetHandle($biaoti)
msgbox(0,"", $H0)
$H1 = ControlGetHandle($H0,"","MDIClient")
msgbox(0,"", $H1)
$H2 = ControlGetHandle($H1,"","FNWND380")
msgbox(0,"", $H2)
只有$H0能得到;$H1,$H2均为空.....这是怎么回事呢? |
|