Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created May 9, 2015 21:51
Show Gist options
  • Save kumatti1/70421f8cfa7f95f13cb8 to your computer and use it in GitHub Desktop.
Save kumatti1/70421f8cfa7f95f13cb8 to your computer and use it in GitHub Desktop.
IWebBrowser_Navigate2
Option Explicit
Private Declare PtrSafe _
Function IWebBrowser_Navigate2 Lib "shlwapi.dll" Alias "#575" ( _
ByVal IE As Object, _
ByVal url As LongPtr, _
ByVal Flags As LongPtr, _
ByVal TargetFrameName As LongPtr, _
ByVal PostData As LongPtr, _
ByVal Headers As LongPtr _
) As Long
Sub hoge()
Const url = "https://www.google.co.jp/?gws_rd=ssl"
Dim IE As Object
Set IE = CreateObject("Shell.Application").Windows.findwindowSW(url, Empty, 1, 0, 1)
If IE Is Nothing Then Exit Sub
Dim hr As Long
hr = IWebBrowser_Navigate2(IE, StrPtr("http://www.yahoo.co.jp/"), 0, 0, 0, 0)
Debug.Print Hex$(hr)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment