First of all, let me tell you that you are probably trying to do a dirty things. Writing UI simulation mouse clicks is bad thing. However, I understand that it might be reasonably used for some special purposes: creation and playing back mouse/keyboard macro, creation of the demonstrations, etc.
What you are trying to do is not universal and not reliable, it cannot work in all cases. The only decent way to simulate the user input it this method:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[
^].
This is a really low-level and universal function, it works exactly as it would do via a keyboard or a mouse driver. Always works.
—SA