|
-
Jun 30th, 2006, 11:08 PM
#1
Thread Starter
PowerPoster
[RESOLVED] How can i open wmv files in vb 6?
hey guys on a form in a vb6 program it has a button and i want it so when one presses it it opens a wmv file. What coding could i use for it? thanks alot.
-
Jun 30th, 2006, 11:25 PM
#2
Re: How can i open wmv files in vb 6?
You want to open the wmv file in windows media player or in your form?
-
Jun 30th, 2006, 11:27 PM
#3
Re: How can i open wmv files in vb 6?
If you want to open a wmv file with its default application you need to use Shell Execute api. check out the link:
How to open any file with its default application
-
Jun 30th, 2006, 11:39 PM
#4
Thread Starter
PowerPoster
Re: How can i open wmv files in vb 6?
ok thanks alot, now the code for my form looks like this
VB Code:
'System & API - How to open any file with its default application
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
Public Sub OpenFile(ByVal sFileName As String)
Call ShellExecute(0, "Open", sFileName, vbNullString, vbNullString, vbNormalFocus)
End Sub
'How can I call this function:
'Call OpenFile("www.gmail.com")
Private Sub Command1_Click()
End Sub
Umm the file i want to use is called "GettingToNewBrunswick.wmv" where would i tell the code to use it.
-
Jul 1st, 2006, 12:17 AM
#5
Re: How can i open wmv files in vb 6?
It should be:
VB Code:
Private Sub Command1_Click()
Call OpenFile("GettingToNewBrunswick.wmv") 'You have to specify the full path of the wmv file. like "C:\Temp\Testing.wmv"
End Sub
-
Jul 1st, 2006, 06:40 AM
#6
Thread Starter
PowerPoster
Re: How can i open wmv files in vb 6?
thanks alot for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|