I emulated the mouse events using PostMessage and tested on the notepad application. I don't want to gain focus of the notepad application by sending mouse events.
The events are received only if I use the ChildWindow of the notepad (ie the white space where you can write) in PostMessage parameters, that means I can't click on the menu of the app (File, Edit ..). Do you have any idea on how to do that without setting the focus?