Simulating a "Mouse Click"

This is a discussion on Simulating a "Mouse Click" within the C++ Programming forums, part of the General Programming Boards category; Im trying to find the code for a simple program in C++ that has a timer that makes the cursor ...

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    1

    Simulating a "Mouse Click"

    Im trying to find the code for a simple program in C++ that has a timer that makes the cursor "click" (left mouse button) every one minute or so. Is there any way to do this? Also, if there is already software that does this.. please tell me. I dont have any programming knowledge, but i take classes soon.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Depends on the operating system you're using.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    you can
    Code:
             SetCursorPos(X, Y);
             mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
             mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    if u r on Windows
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    At previous jobs, I've used WinBatch to automate some daily tasks that required some keyboard and mouse input.

    It's waaaaay easier than C++, but I really don't know how hard it would be for a "non-programmer" to learn... It still requires some "programming".... that is, you have to write a sequence of commands, and use variables, maybe some conditional branching, maybe some loops, etc.

    If you can figure it out, and I think you can, WinBatch would be a great introduction to the world of programming.

    FYI - There are no mouse functions in ANSI/ISO standard C++, so this is normally a specialized-advanced topic in the C++ world. Mouse functions are part of the WinAPI and are standard in every Windows C++ compiler.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 08-28-2008, 09:10 PM
  2. Simulating Internet Conditions On My PC
    By SMurf in forum Tech Board
    Replies: 2
    Last Post: 01-09-2008, 11:04 PM
  3. Simulating mouse movement in other windows
    By Wiretron in forum Windows Programming
    Replies: 11
    Last Post: 10-13-2007, 09:11 AM
  4. simulating key with c++
    By adr in forum C++ Programming
    Replies: 9
    Last Post: 01-02-2006, 04:20 PM
  5. Simulating Shift Key
    By PrimeTime00 in forum Windows Programming
    Replies: 7
    Last Post: 10-15-2004, 06:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21