Results 1 to 9 of 9

Thread: how to do autoit's "ControlClick" in vb6

  1. #1
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51

    how to do autoit's "ControlClick" in vb6

    I'm determined to get this working in vb6 instead of writing a seperate app in autoit and i cant find any info on the net so i need you guys help. I'm trying to send mouse clicks to a external apps control in vb6. i do not want to physically move the mouse. In this case i have the window handle and the names for the controls, i simply need the function to send the clicks. Thanks
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  2. #2
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    You can use AutoIt's com object

  3. #3
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    Quote Originally Posted by Arrow View Post
    You can use AutoIt's com object
    i never even knew autoit hadda com object. Cheap and dirty way to do it.. i like!
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  4. #4
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    Yeah, check it out. It's included with the AutoIt download. It includes just about all the functionality of autoit.

  5. #5
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    I just posted the question on experts-exchange. Maybe someone will have a more direct way of doing this, as I am also curious. I've used the AutoIt COM object before, but if that extra dll can be eliminated, that would help make a smaller easier to handle package.

  6. #6

  7. #7
    Variable Bitrate Arrow's Avatar
    Join Date
    Feb 2006
    Location
    West Lafayette, IN
    Posts
    288
    See this helps

  8. #8
    Newbie
    Join Date
    Feb 2008
    Posts
    1

    PowerShell AutoItX

    Hi! I am trying to do almost the same using PowerShell via AutoItX COM interface.

    Does anybody know how to do ControlClick ?

    pjo

    -----------
    PS
    How do I find ControlID of a button of a window application ?

  9. #9
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    Here's how I click on a control in another app through code. All you need is the handle.

    Code:
    '''''''
    Private Declare Function SendMessage_Long Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef LParam As Long) As Long
    Private Const WM_LBUTTONDOWN  As Long = &H201
    Private Const WM_LBUTTONUP    As Long = &H202
    Private Const WM_KEYUP        As Long = &H101
    Private Const WM_KEYDOWN      As Long = &H100
    Private Const VK_SPACE    As Long = &H20
    ''''''''
    
    Public Sub WindowAPI_Click(ByVal hwnd As Long)
    
    Dim retVal As Long
    
    retVal = SendMessage_Long(hwnd, WM_LBUTTONDOWN, 0&, ByVal 0&)
    retVal = SendMessage_Long(hwnd, WM_LBUTTONDOWN, 0&, ByVal 0&)
    retVal = SendMessage_Long(hwnd, WM_KEYUP, VK_SPACE, ByVal 0&)
    retVal = SendMessage_Long(hwnd, WM_LBUTTONUP, 0&, ByVal 0&)
    
    End Sub

Similar Threads

  1. VB6 vs VB 2005 Express
    By alimh in forum Road Runner
    Replies: 11
    Last Post: 01-28-2009, 04:43 AM
  2. VB6 FileSystemObject woes
    By inh in forum Coders Corner
    Replies: 6
    Last Post: 02-05-2008, 05:08 AM
  3. Questions about Destinator 3 SDK and VB6
    By gsova in forum Coders Corner
    Replies: 4
    Last Post: 01-17-2007, 06:36 AM
  4. Replies: 2
    Last Post: 10-15-2006, 06:19 PM
  5. Screwy docked toolbox in VB6!!
    By deadweasel in forum Software & Software Development
    Replies: 5
    Last Post: 02-12-2004, 02:06 AM

Bookmarks

Posting Permissions

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