Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How can I open a web page and then get the handle of the window it's opened in? I've tried the following as a start, but, although the web page opens OK, k is always Nothing.

 

 Dim k As System.Diagnostics.Process = Process.Start("http://www.google.com")

  • Administrators
Posted

Process.Start only returns a process object if it has to create a new process, there is a good chance that there is already a web browser open and this process will be reused.

 

Depending on what you are trying to do (and if you want to honour the users' browser choice or not) you could always add a reference to IE and use that...

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Even if I close down all browser windows before running this line of code, k is still Nothing.

 

I'm trying to log-in to an account of mine automatically at a certain time of day. I have Firefox as my default browser which has the advantage that my username and password are completed automatically and all I have to do is click the button for logging in. I want the handle of the window so that I can ensure that it is the foreground window and I can click on the button (which I can do automatically). I suppose I could just note what the text of the log-in window is and use FindWindow, but it would seem better if I can get the handle from when I open the page, because the text might change in time.

Guest Boality09
Posted

Beastux. I did what you suggested, and now its working like a champ. I cant say though that I understood much of what I was doing when I was following your recipe.

 

Now, if only the reverse could be done, i.e. have Firefox open a compose window in Thunderbird when I click on an email address in a web page. At this point Im only getting an error message mailto is not a registered protocol. Any suggestions?

Posted
Beastux. I did what you suggested, and now its working like a champ. I cant say though that I understood much of what I was doing when I was following your recipe.

 

Now, if only the reverse could be done, i.e. have Firefox open a compose window in Thunderbird when I click on an email address in a web page. At this point Im only getting an error message mailto is not a registered protocol. Any suggestions?

 

Have you posted this in the wrong thread?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...