|
本帖最后由 oceanwind 于 2012-7-27 09:44 编辑
有一个控件 用坐标法找找其ID然后controlsettext不行
但是可以用类别名来运行controlsettext
有没有办法根据坐标找类别名?
请指教
谢谢先
以下代码 用"Edit69"可行而用其ID却不行
#include <GuiTab.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <SendMessage.au3>
#include <Date.au3>
Opt('TrayMenuMode', 1) ;单击不暂停
Opt("WinTitleMatchMode", 2)
Opt("SendKeyDelay", 200)
Global $whTitle="1124xxxxx -- 权益"
WinActivate($whTitle)
Sleep(5)
$whhyid = _get_ctr_id_by_zb(40, 63)
ControlSetText($whTitle, "", "Edit69" , "ro1301");可行
ControlSetText($whTitle, "", $whhyid , "ro1301");不可行
Func _get_ctr_id_by_zb($zb1, $zb2)
Local $controlid
$tPoint = DllStructCreate($tagPoint)
DllStructSetData($tPoint, 1, $zb1)
DllStructSetData($tPoint, 2, $zb2)
;_WinAPI_ClientToScreen(WinGetHandle($tar_Title), $tpoint)
$hWnd = _WinAPI_WindowFromPoint($tPoint)
$controlid = _WinAPI_GetDlgCtrlID($hWnd)
Return $controlid
EndFunc |
|