Bring to Front

  • Thread starter Charles A. Lackman
  • 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
 
H

Herfried K. Wagner [MVP]

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/>).
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top