views:

816

answers:

3

How can I simulate the mouse click in a directx application? mouse_event and PostMessage with WM_LBUTTONDOWN don't work...

so it must be something to do with the DirectInput

I haven't found out nothing useful with google, so you may be knowing the answer...

thanks in advance

//update

I wrote the text wrongly, what I want is to make the directx app believe that the mouse has just clicked, but without effectively using the mouse and without using SendInput or mouse_event, which need that the window must be focused

A: 

If it is your own application, could you refactor out the click event into something like (in psuedocode):

void click(int x, int y)  {
     do_action();
}

or

void area_click(int x, int y) {
     do_action();
}

which is called by the real click handler.

Lucas Jones
My guess is that he is trying to cheat in some game.
erikkallen
A: 

Tried postmessage?

PoweRoy
+2  A: 

Try AutoIt it is perfect for sending a click to a particular control. The

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

command can do exactly what you want. The directx control will detect the click.

Copas