- Home
·
- Internet/HTML
·
- ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy
ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy
ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy
API Declarations
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 Const conSwNormal = 1
Rate ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy
(1(1 Vote))
' such as www.vbcode.com and it will open
'their default browser to that page
'****************************************
'Created and Tested in VB 6.0 by Andy P.
'****************************************
'create a new project
'Add a command button (command1)
'Add this code under the command button
Private Sub Command1_Click()
dim Results$
Results$ = InputBox("Enter website" + vbCrLf + vbCrLf + "i.e. " & "www.vbcode.com", "Internet") 'Gets web address from Inputbox
ShellExecute hwnd, "open", Results$, vbNullString, vbNullString, conSwNormal
End Sub
'Then run it, but beware, since you are calling and "OPEN" function,
'if you hit cancel, it will open up a folder, and leaving it blank
'will do the same. Also make sure to include the "www" or it won't work
'Questions/Comments? Email me
ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy Comments
No comments yet — be the first to post one!
Post a Comment