473,763 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find a specific window and open a URL.

I need to use an existing IE window which already has a specific url and
re-use that window for a new URL.

Example:

One open IE window has the following in its Address Bar:

http://www.vbcity.com/forums/search.asp?mode=doit

The window title is:

vbCity/DevCity.Net Forums :: Search for - search find window- Microsoft
Internet Explorer

I want to re-use this window to display a new URL. My code to find this
window is:

Friend Sub FindWindowHwnd( ByVal strTitle As String)
' Get the target's window handle.
Dim target_hwnd As Double = FindWindow(vbNu llString, strTitle & "*")
If (target_hwnd = 0) Then
MessageBox.Show ("Error finding target window handle")
Exit Sub
End If
MessageBox.Show (target_hwnd)
End Sub

I will call the window like this:

Call FindWindowHandl e.FindWindowHwn d("VBCity")

So how do I use the window's Hwnd to send it a new URL?

--
|
+-- Thief_
|
Nov 21 '05 #1
3 3037
Thief,

Are you not busy on the client computer?

That is mostly done by JavaScript and very seldom with VBS.

I hope this helps,

Cor
Nov 21 '05 #2
What are you talking about?? Who mentioned VBS- this is a VB.Net newsgroup!

--
|
+-- Thief_
|

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:uZ******** *****@TK2MSFTNG P11.phx.gbl...
Thief,

Are you not busy on the client computer?

That is mostly done by JavaScript and very seldom with VBS.

I hope this helps,

Cor

Nov 21 '05 #3
"Thief_" <th****@hotmail .com> schrieb:
I need to use an existing IE window which already has a specific url and
re-use that window for a new URL.


Add a reference to "Microsoft Internet Controls", then use the code below:

\\\
' Written by Herfried K. Wagner [MVP].
Public Function ReplaceInternet ExplorerUrl( _
ByVal OldUrl As String, _
ByVal NewUrl As String, _
Optional ByVal ReplaceFirstIns tanceOnly As Boolean = False _
) As Integer
Dim i As Integer
For Each IE As InternetExplore r In New ShellWindows
If IE.LocationURL = OldUrl Then
IE.Navigate(New Url)
i += 1
If ReplaceFirstIns tanceOnly Then
Exit For
End If
End If
Next IE
Return i
End Function
///

Usage:

\\\
MsgBox(ReplaceI nternetExplorer Url("http://www.google.de/",
"http://search.msn.com/"))
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
8846
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page (same folder). The cookie is not received. Can someone explain why? I worked around this by adding a cache-control header with a value of no-cache. This fixes the problem. Unfortunately that causes another problem with Internet Explorer...
1
21026
by: F | last post by:
I'm trying to open a window in a specific position of the screen with this script: window.open('window.htm','mywindow','width=250,height=350,screenX=20,screenY =100') it works with Netscape 6.2 but Internet Explorer and Opera just seem to ignore the XY coordinates. Any idea on how to make it work?
6
8225
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone could help me here...? I'd like to use the window.open() script to open a separate window, because I'd like to hide the menubar and specify the window size as well. So I specify "javascript:window.open(...)" as the HTML link for a hotspot. However,...
2
2074
by: Ed Schimmel | last post by:
Hi All, I have a small question considiring the opening of a new window in javascript. As you all know the code below will open a new without any bars. But when I tried this code in IE6 it won't run. I have looked for some documentation but couldn't find all the 'new' parameters for IE6 to open a window without any bars. As far as I know the second argument in window.open is no longer there. Maybe some people can help me with my...
4
629
by: margaret | last post by:
James suggested that I used window.open on the client side to open a new window. I created a test ASP app and can get it work fine. But now I'm trying to fix my real app, which is in ASP.NET. It uses a button with the button handler in the C# code-behind page calling Response.Redirect. I can't find anything that's equivalent to window.open and I don't know enough about ASP to figure out how or where to put the window.open and still...
1
1694
by: jdapro | last post by:
Hi - thanks for reading this out there! I'll be quick about it: I've got this row of images (in the end there will be more rows of pics as well). When a user clicks on the image, I want a new window to open with a larger version of the image. I want that new window to be customized to the size of the new larger image. Also, when users go back to see other images in their larger size, I want the new window (assuming they never closed...
8
5657
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var popWindow=window.open('http://www.yahoo.com','','width=600,height=400,toolbar=1,location=1,menubar=1,resizable=1,titlebar=1,directories=1,status=1,scrollbars=1'); the sidebars are disabled. I click on the buttons for bookmarks and history and they do nothing. I...
4
3603
by: Csaba Gabor | last post by:
Up until a few weeks ago, javascript code like window.open("http://mydomain.com", "windowName"); would always bring my new or reused window to the top, with focus. Lately, Firefox (Deer park alpha 2) only brings it to the top if the window is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in Mozilla/Firefox that I can ensure that this
1
2965
by: Angelos | last post by:
Hello there, I am very new to Javascript and before I explain what I want I'll tell you in a few words that I am trying to make a button on a WYSIWYG text editor (RichArea) that previews on a template the content of the editor and not in just an empty page. I can't get around the folowing: I have a page with a form and a text area. In the textarea I write html code or any text.
0
9389
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10003
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9828
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7370
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5271
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2797
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.