Bring another app window to Top

H

High and dRy

I am trying to find how to bring another applications window to the
top of the screen from a C# application.

I can get the process by using this code:
Process[] processes = Process.GetProcessesByName("ToolParamEditor");
But I bring the window of the app to the top.


Thanks,
~Boyed
 
G

Guest

I don't think Winforms wraps SetForegroundWindow, so I imagine you'll need to pinvoke SetForegroundWindow which will require the HWND for the window you want to make the foreground window. SetForegroundWindow can be a finicky beast (MSFT doesn't want other apps to be switching the foreground window since the user should really control this). If you have trouble with it, take a look at AllowSetForegroundWindow.

Hope that helps

Jackson Davis [MSFT]
 

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

Top