|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hi,
I'm trying to add a video to my program so that when I click on a particular button on a toolbar or on a menu item etc. it shows a video. I've used the Open command before, but this seems to only open files to enable things to be added or changed or read, it doesn't actually show the file running. Any ideas how I can get my video to play? Thank you! |
|
#2
|
|||
|
|||
|
This code will not stream your media file to the program itself but it will allow you to have VB send the file to your default media player and begin playing.
Code:
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 Sub Command1_Click() ShellExecute Me.hWnd, "Play", "(your file's path goes here)", vbNullString, "C:\", SW_NORMAL End Sub ---------------------------- note that there are other ways of acheiving this including only putting the file name in the lpFile String and placing the rest of the directory in the lpDirectory String, it works either way. Hope that works for you. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Showing a video |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|