How to keep a window inactive when simulating clicks?

I made a C ++ program that simulates clicks on an inactive window using:

PostMessage (z, WM_LBUTTONDOWN, 0,MAKELONG(t.left+x,t.top+y)); 

But whenever he clicks, he activates the window, and the window moves to the beginning.

Is there a way to make the window remain inactive or in another way click it?

I used SetWindowPos(z , HWND_BOTTOM,....) so that this window is at the bottom of the z-order list, but it is still activated.

EDIT: window - game console.

+4
source share
1 answer

Try switching from PostMessage to SendInput and see if you get the same effect.

0
source

All Articles