You are here:

C++/mouse emulation in C++

Advertisement


Question
Hello,

1- TO begin with, i am using microsoft visual C++ 6.0. Win XP. pentium 3/4 procesor. (intel 80x86)

2- What I am trying to do is to emulate the left mouse click using C++. I haven't tried anything yet cuz i don't know how do it.(but i have C++ experince).

3- BLANK

4- I want the program to initiate a mouse click and then another mouse click after a certain number of seconds (that the user specifies) from the first.

Thanks in advance (salaf)

Answer
emad, Thank you for your question.

Although you can send any of the mouse messages directly to any window using the PostMessage function, you probably want to generate a system-level mouse event. You can do this using the SendInput function.

You can search Microsoft's MSDN Library at http://search.microsoft.com/us/dev/default.asp.

If you have further questions, please do not hesitate to ask.

David Spector

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


David Spector

Expertise

Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.

Experience

I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Publications
Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

Education/Credentials
ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2016 About.com. All rights reserved.