|
-
January 18th, 2009, 03:44 AM
#1
[RESOLVED] Show webpage in a new window?
How can I use the process class to launch the default browser in a new window.
Process.Start("www.google.com"); does not work. It will open a new tab in an exisiting IE instance.
-
January 18th, 2009, 03:51 AM
#2
Re: Show webpage in a new window?
I'm amazed that even works at all. It does, I tested it, but seems odd. Anyway, you can launch the user's default browser as the process instead and pass the url as a command line argument.
-
January 18th, 2009, 04:00 AM
#3
Re: Show webpage in a new window?
 Originally Posted by BigEd781
I'm amazed that even works at all. It does, I tested it, but seems odd. Anyway, you can launch the user's default browser as the process instead and pass the url as a command line argument.
Thanks for responding. By providing just the url, it will ensure that whatever the default browser is set to will launch the page. But my problem is I need the page to launch in a new window. I only use I.E., but I believe firefox, and oprah (lol, ... sorry opera) browsers use tabbed browsing as well. I need the browser to launch in a new window for the task I have at hand. I have already tried specifically launching I.E and setting the argument, and the result is the same.
-
January 18th, 2009, 07:26 AM
#4
Re: Show webpage in a new window?
Thanks, didn't know that. If you start the browser by its executable path with the url as an argument I thought that it starts a brand new process, i.e., new window. let me check..
Last edited by BigEd781; January 18th, 2009 at 07:45 AM.
-
January 18th, 2009, 07:38 AM
#5
Re: Show webpage in a new window?
Yup, this code opens a new window for me every time. However, if I go for the default http\shell\open command, it opens another tab for me in firefox.
Code:
public partial class Form1 : Form
{
public Form1()
{
Process.Start(GetDefaultBrowserPath(), "www.google.com");
}
private string GetDefaultBrowserPath()
{
//string key = @"http\shell\open\command"; <--opens a new tab
string key = @"htmlfile\shell\open\command";
Microsoft.Win32.RegistryKey registryKey =
Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(key, false);
return ((string)registryKey.GetValue(null, null)).Split('"')[1];
}
}
-
January 18th, 2009, 06:35 PM
#6
Re: Show webpage in a new window?
well, that worked, but I'm still in a bind.
I'm trying to setparent for the browser window.
Any ideas?
Here's basically what I got:
Code:
Process PR = new Process();
PR = Process.Start(GetDefaultBrowserPath(),"www.yahoo.com");
PR.WaitForInputIdle();
//System.Threading.Thread.Sleep(10000);
SetParent(PR.MainWindowHandle, thisPanel2.Handle);
I can not find anything about changing a webbrowser's parent, specifically I.E. on google. I am creating a new thread here and marking this thread resolved.
Last edited by Traps; January 18th, 2009 at 09:51 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|