Click here to Skip to main content
11,715,491 members (74,490 online)
Click here to Skip to main content

Tagged as

Setting focus on another application using Process name

, 29 Jul 2011 CPOL 23.3K 4
Rate this:
Please Sign up or sign in to vote.
How to set focus on another application using the process name

VB.NET code:

If Process.GetProcessByName("ExternalApplication").Length >=1 Then
     For Each ObjProcess As Process In Process.GetProcessByName("ExternalApplication")
          AppActivate(ObjProcess.Id)
          SendKeys.SendWait("~")    
     Next
End If

The SendKeys coding is used to maximize the external application when it's minimized. See this link to see more SendKeys commands: http://www.developerfusion.com/article/57/sendkeys-command/[^].

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ramanujam Shankar
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 5 Pin
TheCrazyTim7-May-13 17:26
memberTheCrazyTim7-May-13 17:26 
GeneralIs there a better way to do it? without the Sendkeys command? Pin
noobiam25-Mar-13 21:16
membernoobiam25-Mar-13 21:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150901.1 | Last Updated 29 Jul 2011
Article Copyright 2011 by Ramanujam Shankar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid