By eugene2005 - 6/13/2007
I want to invisibly control webbrowser control iwebbrowser2 in form
How to send a click to webbrowser control iwebbrowser2 control it clicks ok on simple html but if there is iframe or frame then it does not click on it
Any suggestions?
I don’t want to click by parsing html code body.outerhtml, tagname ("A").click
Private Sub Command2_Click()
Dim lHandle As Long
lHandle = GetHandle(ie)
MsgBox lHandle
SendClick lHandle, Val(Text2.Text), Val(Text3.Text)
End Sub
Public Sub SendClick(lnghWND As Long, X As Long, Y As Long)
Dim lngResult As Long
Dim lnglParam As Long
lnglParam = (Y * &H10000) + X
lngResult = SendMessage(lnghWND, WM_LBUTTONDOWN, 0&, ByVal lnglParam)
lngResult = SendMessage(lnghWND, WM_LBUTTONUP, 0&, ByVal lnglParam)
txtlog.Text = lnghWND & " " & X & " " & Y & vbCrLf & txtlog.Text
End Sub
|
|