#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
抄阿婆的有些代码,嘿嘿嘿!