OK, I figured out how to do it with the three sites you mentioned using ShellExecute
Use the app I posted and change the code to this: Note you will not need the other Form, just the first one
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
Dim InputLine As String
Combo1.Clear
Open App.Path & "\Google Search Strings.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, InputLine
If InputLine <> vbNullString Then
Combo1.AddItem InputLine
End If
Loop
Close #1
Combo1.Text = Combo1.List(0)
Image2.MousePointer = vbCustom
Image2.MouseIcon = LoadPicture(App.Path & "\HandPointer3232.ico")
End Sub
Private Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
'
' Must be done in KeyUp. This doesn't work if in KeyDown
'
If KeyCode = 13 Then
Command1_Click
End If
End Sub
Private Sub Command1_Click()
Dim FoundSearchArhInComboList As Boolean
Dim ThisSearchString As String
If Combo1.Text = "" Then Exit Sub
FoundSearchArhInComboList = False
ThisSearchString = Combo1.Text
For q = 0 To Combo1.ListCount
If ThisSearchString = Combo1.List(q) Then
FoundSearchArhInComboList = True
Exit For
Stop
End If
Next q
If FoundSearchArhInComboList Then
Open App.Path & "\Google Search Strings.txt" For Output As #1
Print #1, ThisSearchString
For q = 0 To Combo1.ListCount
If Combo1.List(q) <> ThisSearchString Then
Print #1, Combo1.List(q)
End If
Next q
Close #1
Combo1.Clear
Open App.Path & "\Google Search Strings.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, InputLine
If InputLine <> vbNullString Then
Combo1.AddItem InputLine
End If
Loop
Close #1
Combo1.Text = Combo1.List(0)
Else
Open App.Path & "\Google Search Strings.txt" For Output As #1
Print #1, ThisSearchString
For q = 0 To Combo1.ListCount
Print #1, Combo1.List(q)
Next q
Close #1
Combo1.Clear
Open App.Path & "\Google Search Strings.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, InputLine
If InputLine <> vbNullString Then
Combo1.AddItem InputLine
End If
Loop
Close #1
Combo1.Text = Combo1.List(0)
End If
'
' Use Google
'
ShellExecute 0&, vbNullString, "http://www.google.com/search?q=" & frmGoogleSearch.Combo1.Text, vbNullString, vbNullString, SW_SHOWNORMAL
'
' Use Yahoo
'
ShellExecute 0&, vbNullString, "http://search.yahoo.com/search;_ylt=ApV0jxntyveJDDkQlPDu_9CbvZx4?p=" & frmGoogleSearch.Combo1.Text, vbNullString, vbNullString, SW_SHOWNORMAL
'
' Use MSN
'
ShellExecute 0&, vbNullString, "http://www.bing.com/search?q=" & frmGoogleSearch.Combo1.Text, vbNullString, vbNullString, SW_SHOWNORMAL
'
' Comment out the below three
'
'Caption = Search & " [Google Explorer]"
'frmGoogleExplorer.Show
'Me.Hide
End Sub
Private Sub Image2_Click()
Command1_Click
End Sub
Private Sub Label2_Click()
Combo1.Text = ""
End Sub
Private Sub Label3_Click()
Dim FoundSearchArhInComboList As Boolean
Dim ThisSearchString As String
If Combo1.Text = "" Then Exit Sub
FoundSearchArhInComboList = False
If MsgBox("Are you sure you want to delete this entry?", vbYesNo, "Request Delete") = vbNo Then Exit Sub
ThisSearchString = Combo1.Text
For q = 0 To Combo1.ListCount
If ThisSearchString = Combo1.List(q) Then
FoundSearchArhInComboList = True
Exit For
Stop
End If
Next q
If FoundSearchArhInComboList Then
Open App.Path & "\Google Search Strings.txt" For Output As #1
'Print #1, ThisSearchString
For q = 0 To Combo1.ListCount
If Combo1.List(q) <> ThisSearchString Then
Print #1, Combo1.List(q)
End If
Next q
Close #1
Combo1.Clear
Open App.Path & "\Google Search Strings.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, InputLine
Combo1.AddItem InputLine
Loop
Close #1
Combo1.Text = Combo1.List(0)
End If
End Sub
EDIT:
Crap! It appears that only one copy of IE can be launched. For now I guess we will have to go back to using the WebBrowser instead of IE.
I know I can have three copies of IE running at the same time but only if I launch each one at a time by double clicking on it's Desktop Icon. Using Shell it doesn't appear to work that way.
EDIT to EDIT:
It does work. I just noticed that the three sites were added as tabs so all three sites were launched. It's one IE but each site is a tab so all you have to is to tab to each one unless you want all three to show at one time on your screen then I will use Max's idea if he shows me how..