4
Reply

Press ALT+TAB programatically

Amit Ranjan

Amit Ranjan

Aug 13 2011 1:50 PM
9.7k
Hello members

I am working on a program in which i called  a program exe file but the program which i called, using system.diagnostic.start ,givse output
when "alt+tab" is pressed is pressed
followed by "tab"
and finally "Enter"
i dont want any user input in middle i want automatically output from the program plz guide how i can press space bar programatically.

I used the following codes to do this
if (e.Result.Text == "Time")     // TIME has been added to sppech grammmer first
  {
  Process.Start("C://Program Files//amitbot.exe");
  Thread.Sleep(200);
  SendKeys.Send("%{TAB}");
  Thread.Sleep(200);
  SendKeys.Send("{TAB}");
  Thread.Sleep(200);
  SendKeys.Send("{ENTER}");
  }
While this code successfully executes the ALT+TAB command, But the following commands are not executed. Instead message is displayed that programme can't be changed while debugging.


plz give a detailed answer i am struck very badly.

Answers (4)