Created
February 15, 2017 23:37
-
-
Save kumatti1/8d7dcd00cc19841389163873de884e81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Declare PtrSafe _ | |
Function IUnknown_GetWindow Lib "shlwapi.dll" ( _ | |
ByVal punk As IUnknown, _ | |
ByRef phwnd As LongPtr _ | |
) As Long | |
Const WM_LBUTTONDOWN = &H201 | |
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr | |
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) | |
Sub hoge() | |
Dim ie As Object | |
Set ie = CreateObject("InternetExplorer.Application") | |
ie.Visible = True | |
ie.Navigate "https://www.google.co.jp/" | |
While ie.Busy Or ie.ReadyState <> 4 | |
Sleep 1& | |
Wend | |
Dim hwnd As LongPtr | |
IUnknown_GetWindow ie.Document, hwnd | |
SendMessage hwnd, WM_LBUTTONDOWN, 0, 10 * &H10000 Or 10 | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment