User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 375,227 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,245 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:

Mouse Click

Join Date: May 2008
Posts: 38
Reputation: tondeuse34 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
tondeuse34's Avatar
tondeuse34 tondeuse34 is offline Offline
Light Poster

Mouse Click

  #1  
May 9th, 2008
Hey guys, i have done C++ before but gave up on it . But i've came back to it and i'm wondering what is a good way to simulate a left and right click? i guess you would start with this:
#include <iostream>
#include <windows.h>

using namespace std;

int main ()
{
 int n = 1;
 int x;
 int y;

 while (n !=NULL)

 {

 if(GetAsyncKeyState(VK_NUMPAD0))
 (

 mouse_event(MOUSEEVENT_LEFTDOWN, x, y, 100, 100));
 mouse_event(MOUSEEVENT_LEFTDOWN, x, y, 200, 200));

 }

 if(GetAsyncKeyState(VK_NUMBPAD1))
 break;

 }

 return 0;


 }
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 3:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC