Advanced M&K Simulation

Qua
06-08-2005, 12:52 PM
Hey.

I have made this program called Mouse Simulator. It is basicly a function that takes a Form, a Control on that form, and a optional string. Then it moves mouse over the control, clicks, and then simulates keypresses to write the string.

It works fine, but it is limited to controls on my own form. I could be nice if i could get it to work outside my program. Example would be to feed it with the start button, or make it double click on the icon on my desktop called My Computer.

Is that possible?

charlie
06-08-2005, 01:22 PM
... or make it double click on the icon on my desktop called My Computer.
Nice simulation!
Btw, what's the problem? It already works outside the form. If you wanna double-click in MyComputer you are able to do it with the functions you developed.

SetCursorPos x, y
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

The only problem is that you must know the MyComputer coordinates (x, y) and the desktop visible! :whoops: :p



P.D: Nice simulation! (did I already say it?) :D

Qua
06-08-2005, 01:42 PM
Nice simulation!
Btw, what's the problem? It already works outside the form. If you wanna double-click in MyComputer you are able to do it with the functions you developed.

SetCursorPos x, y
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

The only problem is that you must know the MyComputer coordinates (x, y) and the desktop visible! :whoops: :p


Here I feed my function AnalogMovement with a control. What I was looking for was to be able to feed it with stuff outside my application like:
AnalogMovement(StartButton)


P.D: Nice simulation! (did I already say it?) :D
Hehe ya think you mentioned it before :chuckle:

charlie
06-08-2005, 02:23 PM
Mmmmm... I attach a sample project taken from AllAPI.net.
Maybe it can help you.

But if you want to know every "special" Windows control (MyComputer, Net Places, Close Button (the 'X')...), I guess you'll find it a very tedious work... You only have to look the sample. And the sample is for the Start Button only!

I don't know if there's an easier way to do it... :confused:

Qua
06-08-2005, 03:15 PM
Ohh that looks great :D I'll look into it.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum