VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Launch any file

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 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

Rate Launch any file

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

Download this snippet    Add to My Saved Code

Launch any file Comments

No comments have been posted about Launch any file. Why not be the first to post a comment about Launch any file.

Post your comment

Subject:
Message:
0/1000 characters