Jan 5th, 2008, 11:44 AM
#1
Thread Starter
PowerPoster
[RESOLVED] movie playing with MMcontrol
hey guys I am makign a media player but how do I get it so that a movie would play on the same form as the buttons are. AS I use MMcontrol hen I play a movie it opens it own window, can I make a picture box and put the movie in that? Thanks!
Jan 5th, 2008, 12:56 PM
#2
Re: movie playing with MMcontrol
Which player are you using? Media Player or Multimedia control?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 12:57 PM
#3
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
Jan 5th, 2008, 01:01 PM
#4
Re: movie playing with MMcontrol
Ok then you must be shelling the file being played? Can you show some code?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 01:09 PM
#5
Re: movie playing with MMcontrol
Just a hunch but are you specifying the UsesWindows property in the open command or setting that property?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 01:17 PM
#6
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
lol I have no idea, I got this code from another website...
VB Code:
Option Explicit
Private path As String
Private fname As String
Private i As Long
'''Code for shutting down stuff
'' Code for opening webpages ''
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 UnloadAllForms(AForm As Form)
'This code shuts down all forms and prevents multiple instances
' if any other programs are made, make sure they include this code.
Dim frm As Form
For Each frm In Forms
If frm.Name <> AForm.Name Then
Unload frm
Set frm = Nothing
End If
Next
Unload AForm
Set AForm = Nothing
End Sub
Function GetFileLocation() As String
With CommonDialog
.ShowOpen
GetFileLocation = .FileName
End With
End Function
Private Sub MMControl1_Done(NotifyCode As Integer)
MMControl1.FileName = ""
MMControl1.Command = "Close"
MMControl1.Command = "Stop"
End Sub
Private Sub Form_Load()
Dim file_name As String
file_name = App.path
If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
' txtFilename.Text = file_name & "Gears.avi"
' Prepare the MCI control for AVI video.
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "AVIVideo"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
UnloadAllForms Me
End Sub
Private Sub Timer1_Timer()
Slider1 = MMControl1.Position
End Sub
Private Sub Image1_Click()
txtFilename.Text = GetFileLocation
Slider1.Max = MMControl1.Length
' Set the file name.
path = txtFilename.Text
MMControl1.FileName = txtFilename.Text
' Open the MCI device.
MMControl1.Wait = True
MMControl1.Command = "Open"
' Play the video.
MMControl1.Wait = True
MMControl1.Command = "Play"
' Close the device.
MMControl1.Command = "Close"
MMControl1.FileName = path
MMControl1.Command = "Open"
MMControl1.Command = "Play"
i = InStrRev(Me.MMControl1.FileName, "\")
fname = Mid(Me.MMControl1.FileName, i + 1)
Me.List1.AddItem fname
End Sub
Private Sub Image4_Click()
MMControl1.Command = "stop"
End Sub
Private Sub mnuAbout_Click()
MsgBox "MHX Mega Media Player by Microhardxce Enterprises."
End Sub
Private Sub mnuExit_Click()
UnloadAllForms Me
End Sub
Private Sub mnuMore_Click()
ShellExecute Me.hwnd, "open", "http://www.geocities.com/nitrogenocide2003/MHXDownloads2.html", vbNullString, vbNullString, ByVal 1&
End Sub
Jan 5th, 2008, 01:20 PM
#7
Re: movie playing with MMcontrol
Set the UsesWindows =False in your code and see if it helps. Its dependant upon the file type being desired played.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 04:34 PM
#8
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
Ok, where abouts in my code would I set that,
Jan 5th, 2008, 04:56 PM
#9
Re: movie playing with MMcontrol
[colornavy]In your form_load event.[/color]
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 06:38 PM
#10
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
Ok i added it, but I get the error variable not defined??
Jan 5th, 2008, 07:00 PM
#11
Member
Re: movie playing with MMcontrol
Use this instead of UsesWindows.
Code:
MMControl1.hWndDisplay = hWnd
But MMControl is buggy or just bad. Coz whole form just hangs when playing AVI. It will response again after AVI playing is finished.
Jan 5th, 2008, 07:06 PM
#12
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
Jan 5th, 2008, 07:36 PM
#13
Re: movie playing with MMcontrol
You could use the Windows MediaPlayer control.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 09:35 PM
#14
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
ok I added the compoenent, but how do I get the buttons and commands to work?
Jan 5th, 2008, 10:11 PM
#15
Member
Re: movie playing with MMcontrol
Check attachement for simple example i coded for you.
You can change the
Code:
wmp.URL = "C:\WINDOWS\CLOCK.AVI"
to something else of course.
Attached Files
Jan 5th, 2008, 10:59 PM
#16
Thread Starter
PowerPoster
Re: movie playing with MMcontrol
thank you very much!!
Edit, am I allowed to make this part of a program to be available for download? Will microsoft be mad?
Jan 5th, 2008, 11:05 PM
#17
Re: [RESOLVED] movie playing with MMcontrol
No, as the user will need to have Media Player installed.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 11:07 PM
#18
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
So in order for this to work, other people will already need to hav windows media player???
lol
Jan 5th, 2008, 11:13 PM
#19
Re: [RESOLVED] movie playing with MMcontrol
Yes, that a normal fact as you have to signup and register for distribution of their copyrighted program.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 11:15 PM
#20
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
what other things of theirs would I have to sing up and register for to distribute programs I made in VB?
Jan 5th, 2008, 11:18 PM
#21
Re: [RESOLVED] movie playing with MMcontrol
Its not just sign up and your in type of thing. You have to be approved and sign a contract etc. Your better off just prompting the user to download from MS and provide the link upon detection that they dont have WMP installed.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 11:21 PM
#22
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
So I am allowed to distribute the media player I am making, but as long as I tell them to download windows media player too?
Oh crap, I have made other programs in VB and distributed them, did I have to make a contract for that?
Jan 5th, 2008, 11:26 PM
#23
Re: [RESOLVED] movie playing with MMcontrol
No, you can distribute the control but it will not work without the WMP neing installed as the users system needs the dependancy files and rest of the program to make WMP player work like you see it in your app.
Think of it as with the rest of your program. You need to distribute a vb control in your app but it wont work if you dont also distribute the msvbsm60.dll runtime file. It is just that MS allows the distribution of the vb runtimes as its not an actual complete program but a dependancy file. The WMP is a complete standalone program that you are using a small feature of. Basically automating the WMP program within your app.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 11:27 PM
#24
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
Aww I understand now, thanks for clearing that up.
Jan 5th, 2008, 11:30 PM
#25
Re: [RESOLVED] movie playing with MMcontrol
Whatever other programs you have written will not have the same requirements. Its the same legality as if you were using an Access database in your app. Its legal to redistribute the database file you have created and MDAC engine is redistributable so you can access the database via your app without ever showing or displaying the actual GUI of Access because there are alot more files and dependancies that would be needed to run the full Access program. Access the program is NOT redistributable. Each end user needs to have a purchased licensed copy of it in order to view and display any of its GUI and have it work via is GUI front end.
There is an exception to this for Access but I wont confuse you with it
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 5th, 2008, 11:34 PM
#26
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
Ok so dependencies are alright to include, but you can't redistribute entire programs, makes sense lol.
Jan 6th, 2008, 04:55 PM
#27
Thread Starter
PowerPoster
Re: [RESOLVED] movie playing with MMcontrol
Out of curiosity, is there a media control that does not need the user to have wmp installed prior to using the app I make?
Jan 6th, 2008, 05:13 PM
#28
Hyperactive Member
Re: [RESOLVED] movie playing with MMcontrol
Originally Posted by
Justin M
Out of curiosity, is there a media control that does not need the user to have wmp installed prior to using the app I make?
Dude, ither way you look at it.. Your devloping "software" for Windows, and almost all Windows machines have WMP, maybe not the latest but still WMP. Work with what you have. If not, Google it.
Jan 6th, 2008, 07:10 PM
#29
Re: [RESOLVED] movie playing with MMcontrol
But not all machines will have it installed on their Windows. But you can redistribute the setup packages with acceptance of your license application.
http://msdn2.microsoft.com/en-us/lib...11(VS.85).aspx
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
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