|
|||||||
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
New Member
Join Date: Dec 00
Location: Canberra - Australia
Posts: 8
![]() |
Hi there
I'm not terribly advanced in vb, but I've looked through all the help files, and articles, for an answer which I'm sure is very simple. I simply want to be able to press a command button, which will trigger a file (e.g. "c:\media\mysong.mp3"), to be opened with by its associated application (e.g. "Media Player"). just as what would happen if I went to the file in windows explorer, and double clicked it. can somebody please come to my rescue.
__________________
*Waco_Jaco* |
|
|
|
|
|
#2 |
|
old fart
Join Date: Oct 99
Location: the Netherlands
Posts: 2,926
![]() ![]() ![]() |
Code:
Option Explicit
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 SW_SHOWNORMAL = 1
Private Sub Command1_Click()
Dim retVal As Long
retVal = ShellExecute(Me.hwnd, "open", "c:\media\mysong.mp3", vbNullString, vbNullString, SW_SHOWNORMAL)
End Sub
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|