Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 11th, 2007, 09:26 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.diagnostics

Hi


Suppose I have 3 iexplore process running. (a,b and c)

I want that my code should identify the ‘b’ iexplore process and open one url there. (but not in other two iexplore process)

At present I can identify the process but couldnot run the url there so that the page opens in that process window only.

Any help ?



I am using the following code


int i=0,iflag=0,pid=-1; // iflag=0 means no B window is open

                  Process[] p;

                  p=Process.GetProcesses();
                  for (i=0;i<=p.Length-1 ;i++)

                  {

                        string s=p[i].ProcessName;

                        if (p[i].ProcessName =="iexplore")

                        {
                              string s2=p[i].MainWindowTitle ;

                              if (s2=="Google - Microsoft Internet Explorer")

                              { iflag=1;
                                  pid=p[i].Id ;
                              }
                        }

                  }

                  if (iflag==1)

                  {
                        ProcessStartInfo ps=new ProcessStartInfo("iexplore.exe");

                        ps =Process.GetProcessById(pid).StartInfo ;
                        ps.Arguments ="www.rediff.com";
                        ps.UseShellExecute=true;
                        ps.CreateNoWindow =true;
                        Process.Start(ps);
                  }

                  else // if no process B is running it will start the process

                  {
                        Process.Start("www.rediff.com");
                  }








Similar Threads
Thread Thread Starter Forum Replies Last Post
intergrating telnet through System.Diagnostics.Pro sudhirbharti C# 4 March 11th, 2008 11:19 AM
System.Diagnostics.Process.Exited Event bmains General .NET 1 February 25th, 2008 07:23 AM
System.Diagnostics in C# 2005 Express onion2k C# 2005 1 January 28th, 2008 12:42 PM
System.Diagnostics.Process doesn't work on W2K M/C kan_lenny Pro VB.NET 2002/2003 1 December 23rd, 2006 03:53 AM
System.Diagnostics.Process doesn't work on W2K m/c kan_lenny VB.NET 0 October 2nd, 2006 07:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.