VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy

by Capp00 (8 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 26th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



' 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

Download this snippet    Add to My Saved Code

ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy Comments

No comments have been posted about ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy. Why not be the first to post a comment about ShellExecute to a website the user types in. Good shortcut to add to a menu bar. very easy.

Post your comment

Subject:
Message:
0/1000 characters