I am using this code in my d3d9 proxy to "target" a monster:

Code:
		PostMessage ( mywin, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM( (int)allmobs[closest_mob -1].x ,(int)allmobs[closest_mob -1].y));
		PostMessage ( mywin, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM( (int)allmobs[closest_mob -1].x ,(int)allmobs[closest_mob -1].y));
The "crazy" thing is.. it works only when the game is not the active window....


Any ideas?