473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Is it doable,

Hi everybody,

Is it possible to control the mouse action by a C++ program.

For example,

MousePosition(x_location = 100, y_location = 120)

To make it more clear,
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.

It is like “windows automation”
I found many programs that can do this function, but if I am able to
do it through C++, then I am able to do more functions as adding more
complex calculations.
Regards,

Jun 27 '08 #1
6 1187
s.eng.ashraf wrote:
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.
Intriguing how the shortcomings of a badly thought out interface design
bud the strangest flowers...
Jun 27 '08 #2
s.eng.ashraf wrote:
Hi everybody,

Is it possible to control the mouse action by a C++ program.
Yes but...
For example,

MousePosition(x_location = 100, y_location = 120)

To make it more clear,
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.

It is like “windows automation”
I found many programs that can do this function, but if I am able to
do it through C++, then I am able to do more functions as adding more
complex calculations.

This question is off-topic here. Please ask in a newsgroup with either
"windows" or "microsoft" in its name.

See FAQ 5.9 (http://www.parashift.com/c++-faq-lit...t.html#faq-5.9)
Jun 27 '08 #3
"s.eng.ashraf" <S.**********@gmail.comwrote in news:3c8b8121-ff38-4676-
9d***************@k37g2000hsf.googlegroups.com:
Hi everybody,

Is it possible to control the mouse action by a C++ program.

For example,

MousePosition(x_location = 100, y_location = 120)

To make it more clear,
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.

It is like “windows automation”
I found many programs that can do this function, but if I am able to
do it through C++, then I am able to do more functions as adding more
complex calculations.
Regards,

C++ doesn't give you any ability to do mouse control. It's quite likely
your OS does, however, and you should properly address the question in a
more specific group like one of the microsoft groups or one of the X
windows groups if that is where you are targeting.

In general, yes you can move the mouse pointer about. This doesn't
accomplish much though since you will be bypassing the mechanisms that send
the various mouse messages to the applications. You will have to do that
yourself if you want the application to respond as if a user moved the
mouse. (There are several messages that need to be sent, don't stop at the
high level WM_MOUSEMOVE messages there are also messages that allow the app
to change the cursor etc.) When it comes to mouse clicks, you will have to
determine the app under the cursor and generate a WM_COMMAND message (or
whatever) with the appropriate info and send it to the app. There are
undoubtedly ways to do all that, but I am just ensuring that you know there
are a lot of details to be worked out and not much will happen
automatically.

joe
Jun 27 '08 #4
On May 23, 5:45*pm, Joe Greer <jgr...@doubletake.comwrote:
"s.eng.ashraf" <S.Eng.Ash...@gmail.comwrote in news:3c8b8121-ff38-4676-
9d5b-8ebbf232d...@k37g2000hsf.googlegroups.com:


Hi everybody,
Is it possible to control the mouse action by a C++ program.
For example,
MousePosition(x_location = 100, y_location = 120)
To make it more clear,
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.
It is like “windows automation”
I found many programs that can do this function, but if I am able to
do it through C++, then I am able to do more functions as adding more
complex calculations.
Regards,

C++ doesn't give you any ability to do mouse control. *It's quite likely
your OS does, however, and you should properly address the question in a
more specific group like one of the microsoft groups or one of the X
windows groups if that is where you are targeting.

In general, yes you can move the mouse pointer about. *This doesn't
accomplish much though since you will be bypassing the mechanisms that send
the various mouse messages to the applications. *You will have to do that
yourself if you want the application to respond as if a user moved the
mouse. *(There are several messages that need to be sent, don't stop at the
high level WM_MOUSEMOVE messages there are also messages that allow the app
to change the cursor etc.) *When it comes to mouse clicks, you will haveto
determine the app under the cursor and generate a WM_COMMAND message (or
whatever) with the appropriate info and send it to the app. *There are
undoubtedly ways to do all that, but I am just ensuring that you know there
are a lot of details to be worked out and not much will happen
automatically.

joe- Hide quoted text -

- Show quoted text -
Thank to all of who tried to help me,,

I worked on C, and I am not saying that I am an expert on it.
And my little idea tells me that: this is C language, it can do any
thing. And I know my target Mr. red floyd.

The program should include a lot of details as what Mr. Joe said,
But is there any body tried to work on mouse controlling? ,, from
where to start?

Regards,
Jun 27 '08 #5
s.eng.ashraf wrote:
On May 23, 5:45 pm, Joe Greer <jgr...@doubletake.comwrote:
>"s.eng.ashraf" <S.Eng.Ash...@gmail.comwrote in
news:3c8b8121-ff38-4676-
9d5b-8ebbf232d...@k37g2000hsf.googlegroups.com:


>>Hi everybody,
>>Is it possible to control the mouse action by a C++ program.
>>For example,
>>MousePosition(x_location = 100, y_location = 120)
>>To make it more clear,
I might be able to check my email through is C++ program, by
controlling the mouse positions and actions.
Or I might be able to rename thousands of Excel files and change
specific cells in each file by a simple program.
>>It is like “windows automation”
I found many programs that can do this function, but if I am able to
do it through C++, then I am able to do more functions as adding
more complex calculations.
>>Regards,

C++ doesn't give you any ability to do mouse control. It's quite
likely your OS does, however, and you should properly address the
question in a more specific group like one of the microsoft groups
or one of the X windows groups if that is where you are targeting.

In general, yes you can move the mouse pointer about. This doesn't
accomplish much though since you will be bypassing the mechanisms
that send the various mouse messages to the applications. You will
have to do that yourself if you want the application to respond as
if a user moved the mouse. (There are several messages that need to
be sent, don't stop at the high level WM_MOUSEMOVE messages there
are also messages that allow the app to change the cursor etc.) When
it comes to mouse clicks, you will have to determine the app under
the cursor and generate a WM_COMMAND message (or whatever) with the
appropriate info and send it to the app. There are undoubtedly ways
to do all that, but I am just ensuring that you know there are a lot
of details to be worked out and not much will happen automatically.

joe- Hide quoted text -

- Show quoted text -

Thank to all of who tried to help me,,

I worked on C, and I am not saying that I am an expert on it.
And my little idea tells me that: this is C language, it can do any
thing. And I know my target Mr. red floyd.

The program should include a lot of details as what Mr. Joe said,
But is there any body tried to work on mouse controlling? ,, from
where to start?

Regards,
Where to start is in a newsgroup appropriate for your OS, because it'll be
different in each. Because you are mentioning excell files we can presume
you are on a windows platform, so microsoft.public.vc.language may be for
you.

But you might just want to google for "winbatch", there are many versions
and they all do the same thing, windows batch programming with mouse
moviement, clicks, etc...

--
Jim Langston
ta*******@rocketmail.com
Jun 27 '08 #6
Hi,

s.eng.ashraf a écrit :
The program should include a lot of details as what Mr. Joe said,
But is there any body tried to work on mouse controlling? ,, from
where to start?
You should really go to a newsgroup about Windows programming.

I remember that there is a specific set of functions in Win32 API for
generating mouse and keyboards events (much more usable and reliable
than sending or posting WM_MOUSEMOUVE (etc.) messages to the target
window). I once used it to play minesweeper :) but I've stopped Windows
programming for a while and I couldn't help you further now.

Cheers,
--
Vincent Jacques

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problčme"
Devise Shadock
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Christopher Richards | last post by:
My customer has a login form on their site that goes to a remote database. The remote database creates its own login errors if the user (say) types in the password incorrectly. The customer wants...
3
by: Rene Pijlman | last post by:
There doesn't seem to be an apt package for Python 2.3 on Debian Woody. Should I expect unusual difficulties or unsolvable problems when building and installing 2.3 on Woody from the source...
5
by: CNemo | last post by:
Hi all! I need to write some tracing code for legacy applications. Basically there is the need to trace SQL sent to server from ASP app. Code is very unstructured and dirty, so there is no...
5
by: darrel | last post by:
I have a client that would like to enable some email notification within their application. Normally, I'd just send an email thorugh their SMTP server and be all set. The catch here is that they...
3
by: well_doing | last post by:
I have something like this in declaration. union allInOne{ struct simple_s { int a; int b; } s; struct complex_s { int a; int b;
7
by: fkallgren | last post by:
Hi. I have a little problem. I have a script that is in the scheduler (win32). But every now and then I update this script and I dont want to go to every computer and update it. So now I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.