How to give focus to a 2nd process?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
.... 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
 
Mattias Sjögren said:
Try using the SetForegroundWindow Win32 API, something like

SetForegroundWindow(yourProcess.MainWindowHandle);

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top