When I have to do these kind of things I use SendKeys. It is VB-ish and C# provides a nice interface to use but for C/C++ you'll have to do it . What is nice with it is that you could write scripts and run them instead of hard coding it in your code.