Results 1 to 6 of 6

Thread: Clicking a button in a web page???

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Angry

    How can you automatically click a button on a web page!!!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  2. #2
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91
    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Thumbs up

    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!!!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  4. #4
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91
    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

  5. #5
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    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:
    Code:
    '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
    Sending the tab key is pretty easy

    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

    Dim

  6. #6
    New Member
    Join Date
    Aug 2000
    Posts
    9
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width