Buenas...
He estado intentando realizar tabs para seleccionar otros links mediante sendmessage.. pero no me ha funcionado.. hago el click y no realiza ninguna accion.. dejo el source a ver si alguien encuentra el error..
Form:
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Long
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
Private Const VK_TAB = &H9
Private Sub Command1_Click()
Dim hwnd As Long
hwnd = GetBrowserHandle(Me.hwnd)
SendMessage hwnd, WM_KEYDOWN, VK_TAB, 0&
'SendMessage hWnd, WM_KEYUP, VK_TAB, 0&
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.google.com"
End Sub
Modulo:
Private Declare Function GetClassName Lib "user32.dll" Alias "GetClassNameA" ( _
ByVal hwnd As Long, _
ByVal lpClassName As String, _
ByVal nMaxCount As Long _
) As Long
Private Declare Function EnumChildWindows Lib "user32.dll" ( _
ByVal hWndParent As Long, _
ByVal lpEnumFunc As Long, _
ByVal lParam As Long _
) As Long
Private hWndIE As Long
Private Function EnumChildProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim sClassName As String
sClassName = String(255, vbNullChar)
Call GetClassName(hwnd, sClassName, 255)
sClassName = Left$(sClassName, InStr(sClassName, vbNullChar) - 1)
If sClassName <> "Internet Explorer_Server" Then
EnumChildProc = 1
Else
hWndIE = hwnd
End If
End Function
Public Function GetBrowserHandle(ByVal hWndParent) As Long
hWndIE = 0
Call EnumChildWindows(hWndParent, AddressOf EnumChildProc, 1)
GetBrowserHandle = hWndIE
End Function
Encuentra el handle y todo del webbrowser pero no se porke no realiza los tabs en la pagina..
Saludos!