471,317 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

How to give focus to a 2nd process?

I'm using a browser to display documentation. I've got a Process object to
it stored, but can't find a way to give it focus the 2nd+ time the user
presses the help button.
Feb 1 '06 #1
3 1360
I'm using a browser to display documentation. I've got a Process object to
it stored, but can't find a way to give it focus the 2nd+ time the user
presses the help button.


Try using the SetForegroundWindow Win32 API, something like

SetForegroundWindow(yourProcess.MainWindowHandle);
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 1 '06 #2

.... If that doesn't work you can probably post a bring to front or
focus message to the other process via the Process.MainWindowHandle
property

Feb 2 '06 #3


"Mattias Sjögren" wrote:
I'm using a browser to display documentation. I've got a Process object to
it stored, but can't find a way to give it focus the 2nd+ time the user
presses the help button.


Try using the SetForegroundWindow Win32 API, something like

SetForegroundWindow(yourProcess.MainWindowHandle);


THankyou. That's exactly what I was looking for.

Feb 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by | last post: by
3 posts views Thread by Saurabh Sharma | last post: by
2 posts views Thread by Christian Ista | last post: by
reply views Thread by Elliot | last post: by
3 posts views Thread by Sharon | last post: by
3 posts views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
1 post views Thread by Mex | last post: by
1 post views Thread by massimo s. | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.