Hi, sorry for the late reply. I assumed you knew about the structs. This should work now...
Code:
#include <windows.h>

#define MOUSE_INPUT 0x0000
#define MOUSEEVENTF_LEFTDOWN 0x0002

typedef struct
{
    long dx;
    long dy;
    DWORD mouseData;
    DWORD dwFlags;
    DWORD time;
    long dwExtraInfo;
} 
MOUSEINPUT;

typedef struct
{ 
  DWORD type; 
  MOUSEINPUT mi; 
}
INPUT;

int WINAPI SendInput(int nInputs,INPUT* pInputs,int cbSize);
#define PRAGMA_API SendInput;user32!SendInput

//////////////////////////////////////////////////////////////

void LeftClick()
{  
  INPUT Input;
  Input.type      = MOUSE_INPUT;
  Input.mi.dwFlags  = MOUSEEVENTF_LEFTDOWN;
  SendInput(1,&Input,sizeof(INPUT));
}


I havent included the function to move the mouse, because you can do that by changing mouse_pos/pos_cursor.

Last edited by DJBMASTER; 09/20/09 07:41.