I was wondering if there is a way to simulate mouse movement/clicking in a VB6 application without having it in focus. Like my title says a hidden mouse. Perhaps i have a window completely over my VB app, the mouse can't click the application if there is something over it. I know there are ways to control the mouse/cursor, and i know how to do this. If anyone could lead me in the right direction that would be great.
Last edited by letram; Jul 26th, 2007 at 01:41 AM.
I'm sorry that you mis-understood. Or perhaps I can't explain my self right. I was wondering if there is a way to click something on a VB6 application without using the mouse. Literally 'simulate'. This may sound kind of dumb, but i am wondering. But thank you for the quick reply.
The thing you're "simulating" by - if you can find a way - "clicking the mouse" (in software) is firing the Click event of the control (or form) the mouse cursor is on. So just run the code in the event - either by calling the Click event (sub), which is a bad practice, or by putting that code into another sub and calling it from your "I want to click the mouse here now) code and from the actual Click event.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
if you are wanting to click the button on a program you didn't write yourself, you will need to use the sendmessage or postmessage api to send the button a virtual enter or space.
and this one can click anywhere on a specified window, providing you have its window handle (hWnd as it's commonly called) http://cruels.net/index.php?showtopic=4406 (Or see attachment for direct download)
That is nearly impossible. It is actually not too hard if you leave the window open but i don't recommend you even ask this question in this forum because some people might take it that you are wanting to make a program to cheat on flash games. This is against forum rules.
On a command button or pictures MouseUp Sub, call GetWindow
It saves the window handle in selwnd
Paste this into a module
Code:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Type POINTAPI
x As Long
y As Long
End Type
public selwnd as long
Sub GetWindow()
Dim mousexy As POINTAPI
GetCursorPos mousexy
selwnd = WindowFromPoint(mousexy.x, mousexy.y)
End Sub
he said flash animation which means it's in a web browser. The hard part of this is getting the handle to the flash animation. It is possible to get the handle to the browser window, but even this is not exactly easy.
he said flash animation which means it's in a web browser. The hard part of this is getting the handle to the flash animation. It is possible to get the handle to the browser window, but even this is not exactly easy.
I said exactly what i meant, the shockwave flash component. It loads the .swf directly. And thank you jazz.
Last edited by letram; Jul 27th, 2007 at 01:13 AM.
ok then sorry. It is a form control then? I have never tried putting a shockwave form on a control but i can see how that would be very useful. All the demo disks from pc world run that way.