Dim ret As mshtml.IHTMLDocument2
Dim link As mshtml.IHTMLElement
For i = 1 To ret.links.length
link = ret.links.item(i)
If link.toString.StartsWith("this is my link") Then Exit For
Next
'this generates an error but still works (?) On Error Resume Next so all ok
link.click()
'hangs here untill I manually press one of the itms in the context menu that popup from this link.click()
'if it wouldn't hang I would press on of the items
hWnd = FindWindow("#32768", "") 'find the hwnd of the menu
Dim lnglParam As String = (Cursor.Position.Y * &H10000) + Cursor.Position.X
'Not sure about this ...
SendMessage(hWnd, WM_LBUTTONDOWN, 1&, lnglParam)
SendMessage(hWnd, WM_LBUTTONUP, 1&, lnglParam)
|