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.
 
Back
Top