by Yossi R (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(3 Votes)
With this little function you can LAUNCH ANY TYPE OF FILE that windows reconizes. This means that you can open any type of file that windows has the application for it. For example: You can run a file named "movie.rm" (RealPlayer fomat), but if you don't have Real Player installed, the function just won't do anything! No bugs at all!
API DeclarationsPrivate 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
Public Function Win32Keyword(ByVal URL As String) As Long
weburl = ShellExecute(0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus)
End Function
'For example: put the next code under a commad button:
Private Sub Command1_Click()
win32keyword("C:\bla\bla\movie.rm")
End Sub