You can use AutoIt's com object
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
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.
Hi! I am trying to do almost the same using PowerShell via AutoItX COM interface.
Does anybody know how to do ControlClick ?
How do I find ControlID of a button of a window application ?
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