I would advise to use PostMessage instead SendMessage. If receiving application is ill behaving it may put your application into a zombie state.

Another advice is to use SendInput Function that synthesizes keystrokes and mouse action (movements, and button clicks).

All of the above would be helpful to you if you were in the right forum. It is a C++ forum not C#.