Get Other process Active

  • Thread starter Thread starter windy
  • Start date Start date
W

windy

Hi all,
I wanna know the function to make an process active.
i.e. I have my own process runing. And I want to pass the focus(active
window)
to another existing program on the process list what should I do?

I could got the "Process" class variable of the target program, so what
should I do to achieve it?

Thanks a lot.
Windy.
 
This is one way:

[DllImport ("user32.dll")]
[return: MarshalAs (UnmanagedType.Bool)]
static extern bool SetForegroundWindow (IntPtr hWnd);

SetForegroundWindow (<Process Class Instance>.MainWindowHandle);

Hi all,
I wanna know the function to make an process active.
i.e. I have my own process runing. And I want to pass the focus(active
window)
to another existing program on the process list what should I do?

I could got the "Process" class variable of the target program, so what
should I do to achieve it?

Thanks a lot.
Windy.
 

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