TAB界面下无法检测IE控件,我X这个是属于官方的BUG吧!
本帖最后由 heavenm 于 2013-8-30 20:43 编辑获取成功!
获取失败!
使用了GUICtrlCreateTab就无法获取IE控件
没使用就可以!!这个应该是BUG吧!,如果用AU3的命令点击控件会出现COM错误!; *******************************************************
; 示例1 - 获取COM错误以便外部历史集的'Back'及'Forward'不使脚本退出
; (COM错误将送至控制台)
;
; *******************************************************
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister()
Local $oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$Tab1 = GUICtrlCreateTab(8, 10, 1001, 385)
$TabSheet1 = GUICtrlCreateTabItem("Log")
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
Local $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
Local $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
Local $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
Local $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
$TabSheet2 = GUICtrlCreateTabItem("Browse")
GUICtrlCreateTabItem("");
GUISetState() ;显示GUI
_IENavigate($oIE, "https://login.taobao.com/member/login.jhtml")
; 等待用户关闭窗口
While 1
Local $msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
_IENavigate($oIE, "http://www.autoitscript.com")
Case $msg = $GUI_Button_Back
_IEAction($oIE, "back")
Case $msg = $GUI_Button_Forward
_IEAction($oIE, "forward")
Case $msg = $GUI_Button_Stop
_IEAction($oIE, "stop")
EndSelect
WEnd
GUIDelete()
Exit
好吧!好像是其他错误!
= =#到底哪里出的错我也不知道!真纠结
不过真的是检测不到,但是可以输入的! #region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Res_requestedExecutionLevel=None
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
; *******************************************************
; 示例1 - 获取COM错误以便外部历史集的'Back'及'Forward'不使脚本退出
; (COM错误将送至控制台)
;
; *******************************************************
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister()
Local $oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$Tab1 = GUICtrlCreateTab(8, 10, 1001, 385)
$TabSheet1 = GUICtrlCreateTabItem("Log")
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
Local $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
Local $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
Local $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
Local $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
GUICtrlCreateTabItem("");
GUISetState() ;显示GUI
_IENavigate($oIE, "https://login.taobao.com/member/login.jhtml")
; 等待用户关闭窗口
While 1
Local $msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
ControlClick($oIE.HWnd, "", 'ATL:Edit1')
ControlSend($oIE.HWnd, "", 'ATL:Edit1', "12345")
Case $msg = $GUI_Button_Back
_IEAction($oIE, "back")
Case $msg = $GUI_Button_Forward
_IEAction($oIE, "forward")
Case $msg = $GUI_Button_Stop
_IEAction($oIE, "stop")
EndSelect
WEnd
GUIDelete()
Exit
点HOME即可输入!不过还是不能直接获取! 把tab作为窗体处理,找句柄 看看我发的那个标签页上创建ip地址框的例子 蛋蛋都不用睡觉的!这么晚还在! 可能是吧。
页:
[1]