How can you automatically click a button on a web page!!!
Printable View
How can you automatically click a button on a web page!!!
Dude, I am not sure what you are aiming at. You could place a heavy object on the return key when your internet explorer is up, and then the default key will automatically press, or are you trying to incorporate it into VB?
~Brian
Ok whiteboy! I meant that when I enter a username and password into their fields, I want my program to click on the login button or post the form!!!
Uh, my mac automatically goes after a supplied username and pass is incorporated. In windows Internet Explorer..., I couldn't kind anything, hold down ALT+T then ALT+O . Look there, under advanced, and see if there is a default that can help u out. I apologise that I couldn't help you any further.
~Brian
I would recomd using the mouse move and mouse click events. Or you could send the Tab Key several times untill ir reached the submit button and then send the eneter key:
Sending the tab key is pretty easyCode:'Mouse Move and click
'Declx.
'Mouse Move
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
'Mouse Events
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
'On the form
Public Sub LeftDown()
On Error Resume Next
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
End Sub
Public Sub LeftUp()
On Error Resume Next
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Public Sub Command1_Click()
'Set Cursor Pos (You'll have to figure this out by testing the locations
SetCursorPos 680, 472
'Press The Button
LeftDown
LeftUp
End Sub
Code:SendKeys "{TAB}" 'do it a number of times untill it reached the submit button.
'Then send the enter key
SendKeys "{ENTER}"
Gl,
D!m
I've run into something similar but unfortunaly no resolution. I tried to get a hwnd of the button of a web page and then send a click. All I managed was a hwnd of the entire web form.
John