Sep 04 2008
VB.Net – Windows über Handle in den Vordergrund holen
Public NotInheritable Class Win32Helper
<System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint:="SetForegroundWindow", CallingConvention:=Runtime.InteropServices.CallingConvention.StdCall, CharSet:=Runtime.InteropServices.CharSet.Unicode, SetLastError:=True)> _
Public Shared Function SetForegroundWindow(ByVal handle As IntPtr) As Boolean
End Function
End Class
Und der Aufruf:
Dim Win32Help As New Win32Helper
‘bring windows to front
If Not IntPtr.Zero.Equals(objProcess.MainWindowHandle) Then
Win32Helper.SetForegroundWindow(objProcess.MainWindowHandle)
End If
Wo bei objProcess.MainWindowHandle durch das entsprechende Window-Handle ersetzt werden muss.

