By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Set Focus to a particular process

P: n/a
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

You do not focus on a process, in any case you focus on a form, you can use
Process.MainWindowHandle to get the ID of the main window, then you can
focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to be
focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh

Nov 17 '05 #2

P: n/a
That is working only for the main form but if it is in another form then its
not working. Is there any method to do that.

Regards
Saurabh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uF****************@TK2MSFTNGP09.phx.gbl...
Hi,

You do not focus on a process, in any case you focus on a form, you can
use Process.MainWindowHandle to get the ID of the main window, then you
can focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to be
focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh


Nov 17 '05 #3

P: n/a

Hi,
AFAIK there is not, can you change the target app?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
That is working only for the main form but if it is in another form then
its not working. Is there any method to do that.

Regards
Saurabh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:uF****************@TK2MSFTNGP09.phx.gbl...
Hi,

You do not focus on a process, in any case you focus on a form, you can
use Process.MainWindowHandle to get the ID of the main window, then you
can focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to
be focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh



Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.