找回密码
 加入
搜索
查看: 1816|回复: 1

[IE类操作] IEX调试专用浏览器,期待大神一起完成!大概模型各种BUG

[复制链接]
发表于 2016-8-21 18:38:54 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\portablesync\au3project\iex\iex.kxf
$Form1 = GUICreate("IEX", 1717, 691, 190, 122)
$Tab1 = GUICtrlCreateTab(8, 40, 1705, 641)
$TabSheet1 = GUICtrlCreateTabItem("Browse")
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 16, 72, 1690, 604)
$TabSheet2 = GUICtrlCreateTabItem("Source")
$TabSheet3 = GUICtrlCreateTabItem("Setting")
$TabSheet4 = GUICtrlCreateTabItem("Request")
$TabSheet5 = GUICtrlCreateTabItem("Cookie")
$TabSheet6 = GUICtrlCreateTabItem("Element")
$TabSheet7 = GUICtrlCreateTabItem("About/Info")
GUICtrlCreateTabItem("")
$Combo1 = GUICtrlCreateCombo("", 8, 8, 1673, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("O", 1688, 7, 23, 22)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#include <EditConstants.au3>
$Form2 = GUICreate("Objects and Events (Internet Explorer)", 1717, 149, 189, 849)
$Combo2_1 = GUICtrlCreateCombo("All", 8, 8, 265, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$Edit1 = GUICtrlCreateEdit("", 8, 32, 1705, 113, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUISetState(@SW_SHOW)


#include <IE.au3>
#include <WinAPI.au3>
#include <GuiEdit.au3>
Global Const $VK_RETURN = 0x0D
GUICtrlSetData($Combo2_1, "DWebBrowserEvents2", "ALL")
ObjEvent($Obj1, "_IEEvent_", "DWebBrowserEvents2")
;~ ObjEvent($Obj1, "_IEEvent_", "DWebBrowserEvents")
$Edit = ControlGetHandle(GUICtrlGetHandle($Combo1), "", "Edit1")
$wProcNew = DllCallbackRegister("_MyWindowProc", "ptr", "hwnd;uint;long;ptr")
$wProcOld = _WinAPI_SetWindowLong($Edit, -4, DllCallbackGetPtr($wProcNew))
_IENavigate($Obj1, 'baidu.com')



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

Func _MyWindowProc($hWnd, $uiMsg, $wParam, $lParam)
        Switch $uiMsg
                Case $WM_KEYUP
                        Switch $wParam
                                Case $VK_RETURN
                                        _IENavigate($Obj1, GUICtrlRead($Combo1))
                        EndSwitch
        EndSwitch
        Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $uiMsg, $wParam, $lParam)
EndFunc   ;==>_MyWindowProc

;~ Func _IEEvent_NavigateComplete($URL);读写,可对导航进行重定向
;~         ConsoleWrite("> _IEEvent_NavigateComplete ][ "  & $URL & @CRLF)
;~ EndFunc   ;==>_IEEvent_NavigateComplete

Func _IEEvent_NavigateComplete2($pDisp, $URL);读写,可对导航进行重定向
        Local $_Text = "> _IEEvent_NavigateComplete2 ][ " & ObjName($pDisp) & ' ][ ' & $URL & @CRLF
        ConsoleWrite($_Text)
        _GUICtrlEdit_AppendText($Edit1, $_Text)
        GUICtrlSetData($Combo1, $URL, $URL)
EndFunc   ;==>_IEEvent_NavigateComplete2

Func _IEEvent_OnQuit()
        Local $_Text = "> _IEEvent_OnQuit ][ EXIT" & @CRLF
        ConsoleWrite($_Text)
        _GUICtrlEdit_AppendText($Edit1, $_Text)
EndFunc   ;==>_IEEvent_OnQuit

Func _IEEvent_DocumentComplete($pDisp, $URL)
        Local $_Text = "> _IEEvent_DocumentComplete ][ " & ObjName($pDisp) & ' ][ ' & $URL & @CRLF
        ConsoleWrite($_Text)
        _GUICtrlEdit_AppendText($Edit1, $_Text)
EndFunc   ;==>_IEEvent_DocumentComplete
抄阿婆的有些代码,嘿嘿嘿!
DWebBrowserEvents NavigateComplete 点击百度[新闻]返回正常链接地址
DWebBrowserEvents2 NavigateComplete2 点击百度[新闻]返回错误链接地址
 楼主| 发表于 2016-8-21 18:40:06 | 显示全部楼层
本帖最后由 heavenm 于 2016-8-21 19:24 编辑

NavigateComplete2 和_DocumentComplete 都无法正确的判断URL
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-15 12:15 , Processed in 0.117052 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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