-
August 7th, 2003, 02:58 PM
#1
[VB] ShellExecute to open many windows
I am trying to open 2 to 3 web browsers with a call to shellexecute() but shellexecutes uses the same window all of the time.. example I ask shellexecute to load www.yahoo.com and www.google.com.. they both go up in the same window and I have to hit the back button to see the first site... I want it to open up in 2 different windows..
code::
Dim ii As Integer
For ii = 0 To urllist.length - 1
rc = ShellExecute(App.hInstance, "open", _
urllist.Item(ii).Text, vbNullString, "C:\", _
SW_SHOWNORMAL)
Next ii
urllist.Item(0).Text = www.yahoo.com
urllist.Item(1).Text = www.google.com
I want these to come up in 2 seperate windows..
thanks in advanced
-
August 7th, 2003, 06:03 PM
#2
if you want them to open in seperate windows , dont use shellexecute , use Shell . eg:
Code:
Private Sub Command1_Click()
Dim strUrls() As String
Dim x As Integer
strUrls = Split("http://google.com,http://yahoo.com", ",")
For x = LBound(strUrls) To UBound(strUrls)
Shell("explorer.exe " & strUrls(x), vbNormalFocus)
Next
End Sub
string Signature = Censored;
-
August 8th, 2003, 10:19 AM
#3
small addition to sysop code
Shell("explorer.exe " & Chr$(34) _
& urllist.Item(ii).Text & Chr$(34), vbNormalFocus)
this works better cause it contains all of the data.
otherwise you may have some trouble with SOME urls
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
|