QUOTE(jpw1991 @ 19 Sep, 2007 - 02:55 AM)

Hello. I'm trying to make a program that performs a mouse click. I'm unsure why it isn't working.
I used MSDN for the structure of this code.
CODE
#include <windows.h>
#include <winuser.h>
int main()
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 757, 447, 0, 0);
return 0;
}
The code compiles, but when I run it I don't think its performing the mouse click.
I've also heard that mouse_event() is the old way of doing it, and that I should be using SendInput(), but I don't understand the structure MSDN has provided. If anyone could provide an example of code that performs a mouse click using SendInput() I'd be very grateful.
Thanks in advance,
jpw1991
when I use the code below, it works.
mouse_event(MOUSEEVENT_LEFTDOWN, 100,100,0,0);
mouse_event(MOUSEEVENT_LEFTUP, 100,100,0,0);