VB code to automate mouse to click a button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BSB
    New Member
    • Jul 2007
    • 19

    VB code to automate mouse to click a button

    Hi

    I use VB6.0 as front end...
    I want something like,
    When my application displays a particular message, It should trigger an event which clicks the button


    Say whenever " Hello World " message is displayed, my program should make my mouse pointer to and click the button "GO"

    I should be able to use this function at many places


    Is there any way to do it???
  • pureenhanoi
    New Member
    • Mar 2007
    • 175

    #2
    Originally posted by BSB
    Hi

    I use VB6.0 as front end...
    I want something like,
    When my application displays a particular message, It should trigger an event which clicks the button


    Say whenever " Hello World " message is displayed, my program should make my mouse pointer to and click the button "GO"

    I should be able to use this function at many places


    Is there any way to do it???
    Private Sub helloWorldMsg()
    msgbox "Hello world"
    cmdGo_Click()
    End Sub
    Private Sub cmdGo_Click()
    'do anything for click event of cmdGo
    End Sub
    'anywhere you need show hello world msg
    Call helloWorldMsg()

    Comment

    • BSB
      New Member
      • Jul 2007
      • 19

      #3
      Originally posted by pureenhanoi
      Private Sub helloWorldMsg()
      msgbox "Hello world"
      cmdGo_Click()
      End Sub
      Private Sub cmdGo_Click()
      'do anything for click event of cmdGo
      End Sub
      'anywhere you need show hello world msg
      Call helloWorldMsg()
      *************** *************** *************** ***
      thank u lemme check

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by BSB
        thank u lemme check
        I think that's probably the best you'll get unless you want to go into some fairly complex API calls to watch Windows messages and stuff.

        Comment

        • pureenhanoi
          New Member
          • Mar 2007
          • 175

          #5
          Originally posted by Killer42
          I think that's probably the best you'll get unless you want to go into some fairly complex API calls to watch Windows messages and stuff.
          I dont know how professional BSB is, but say about watch Windows message, it seem to be a complex thing.

          Comment

          Working...