Try this one:
Code:
#USING System.Diagnostics #USING System.Threading #USING System.Runtime.InteropServices [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetForegroundWindow(IntPtr hWnd); void Main( object param ) { if( sh.GetContext( "Toshiba Network Camera" ) == null ) { sh.SetContext( "Toshiba Network Camera", true ); IntPtr hWnd = FindWindow(null,"Bellwoods1 (VGA) TOSHIBA Network Camera - IK-WB15A. - Windows Internet Explorer"); if( hWnd == IntPtr.Zero ) { ProcessStartInfo processStartInfo = new ProcessStartInfo(); processStartInfo.FileName = "IEXPLORE.EXE"; processStartInfo.Arguments = param.ToString(); processStartInfo.WindowStyle = ProcessWindowStyle.Maximized; Process.Start( processStartInfo ); Thread.Sleep( 3000 ); } else { SetForegroundWindow( hWnd ); } sh.SetContext( "Toshiba Network Camera", null ); } }
Comment