0

I have my C# program. i want my program called teamviewer foreground and write some numbers. this time can call the teamviewer for foreground but can not write to it.

Already tried with senkeys but does not work!! the sendkeys works in notepad and calculator, but teamviewer does not work :/

[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);

Process p = Process.GetProcessById(processID);
SetForegroundWindow(p.MainWindowHandle);

After this i want to senkeys to teamViewer....

someone can help me ??? Thanks

Francisco Carvalho
  • 4,123
  • 3
  • 16
  • 12
  • Maybe try the SendWait method? http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.sendwait(v=vs.110).aspx – seekerOfKnowledge Nov 07 '13 at 13:50
  • not work, the "SendWait" works perfectly in other application, notepad etc ... but teamviewer not working :/ – Francisco Carvalho Nov 07 '13 at 15:08
  • 1
    TeamViewr is protected virtual key. The solution I found is the following ... 'ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "C:\\Program Files (x86)\\TeamViewer\\Version8\\TeamViewer.exe"; startInfo.Arguments = "-i " + IdConneccao + " --Password " + Password; Process.Start(startInfo);' – Francisco Carvalho Nov 08 '13 at 12:55

0 Answers0