Bring to Front

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

Hello,

I have created an application that searches to see if a process is running
and if it is it maximizes it's window.

i.e.

For Each AProcess In AProcesses
If AProcess.StartInfo.WindowStyle <> ProcessWindowStyle.Maximized Then
AProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
ShowWindow(AProcess.MainWindowHandle, 3)
End If
Next

Is there also a way to make the window "BRING TO FRONT" also?

Thanks,

Chuck
 
Charles A. Lackman said:
For Each AProcess In AProcesses
If AProcess.StartInfo.WindowStyle <> ProcessWindowStyle.Maximized Then
AProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
ShowWindow(AProcess.MainWindowHandle, 3)
End If
Next

Is there also a way to make the window "BRING TO FRONT" also?

You can use the 'SetForegroundWindow' function (+ 'MainWindowHandle' as
handle) to do that (for more info, see MSDN and
<URL:http://www.pinvoke.net/>).
 
Back
Top