To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Apr 13th, 2001, 07:36 AM   #1
Waco_Jaco
New Member
 
Join Date: Dec 00
Location: Canberra - Australia
Posts: 8
Waco_Jaco is an unknown quantity at this point (<10)
Question

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*
Waco_Jaco is offline   Reply With Quote
Old Apr 13th, 2001, 07:56 AM   #2
Frans C
old fart
 
Frans C's Avatar
 
Join Date: Oct 99
Location: the Netherlands
Posts: 2,926
Frans C is a jewel in the rough (200+)Frans C is a jewel in the rough (200+)Frans C is a jewel in the rough (200+)
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
Frans C is offline   Reply With Quote
Old Apr 13th, 2001, 07:56 AM   #3
taLON
Guest
 
Posts: n/a
take a look at http://www.vbsquare.com/tips/tip236.html

greets

taLON
  Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:52 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.