 |
Beat Master BoB Level: Protégé
 Registered: 07-04-2006 Posts: 6
|
VB.NET (NOT VB6!) Video Playing Help ...
Hello all ... new to the board, I used to code in VB6 years ago but have now been forced by my Uni to learn VB.NET.
Basically I want to play an AVI video in my program from a picture box (or something similar, like you used to be able to do in VB6) using the mciSendString API.
I have mciSendString playing videos in seperate small windows or full screen but thats not really very useful.
Please please please nobody tell me to use WMP or MMMC as this wont do!
Big thanks to everyone in advance ...
BoB
____________________________
people usually just say ... Rimmer your a total git!
|
|
07-04-2006 at 02:02 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
You said you have used mciSendString API in VB6. Why cant you use it in .NET?
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
10-04-2006 at 04:04 PM |
|
|
Beat Master BoB Level: Protégé
 Registered: 07-04-2006 Posts: 6
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
quote: Goran wrote:
You said you have used mciSendString API in VB6. Why cant you use it in .NET?
Because in VB6 I think you could use the hWnd property of picture boxes and run the video through it, it doesnt seem to work like this in VB.NET.
I also no longer have my VB6 projects / examples to refer to!
____________________________
people usually just say ... Rimmer your a total git!
|
|
10-04-2006 at 05:55 PM |
|
|
Beat Master BoB Level: Protégé
 Registered: 07-04-2006 Posts: 6
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
After having a big search through old hard drives ... I am basically looking for a vb.net version of this vb6 code ... ... ...
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
moo1 = Form1.hWnd & " Style " & &H40000000
moo2 = "open <c:\windows\clock.avi> Type avivideo Alias video parent " & moo1
moo3 = mciSendString(moo2, 0&, 0, 0)
moo3 = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)
moo3 = mciSendString("play video wait", 0&, 0, 0)
moo3 = mciSendString("close video", 0&, 0, 0)
I think I was mistaken about the picture box, it seems that after you have your parent window set to your form you just select its location and size.
Goran Please !!!
Thanks all ...
____________________________
people usually just say ... Rimmer your a total git!
|
|
11-04-2006 at 03:11 PM |
|
|
Beat Master BoB Level: Protégé
 Registered: 07-04-2006 Posts: 6
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
HAHAAHAHhhhhhhhhhhhhhhhhhaaaaaaaaaaaaa
Done It AT LAST    
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Declare Function GetActiveWindow Lib "USER32" () As Integer
mciSendString("open C:\WINDOWS\CLOCK.AVI alias smeg parent " & GetActiveWindow & " style " & &H40000000, "", 0, 0)
mciSendString("put smeg window at 100 100 100 100", "", 0, 0)
mciSendString("play smeg", "", 0, 0)
____________________________
people usually just say ... Rimmer your a total git!
|
|
11-04-2006 at 04:09 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
YOu didnt declare mciSendString the right way. It should be
| Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer |
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
11-04-2006 at 08:05 PM |
|
|
Beat Master BoB Level: Protégé
 Registered: 07-04-2006 Posts: 6
|
Re: VB.NET (NOT VB6!) Video Playing Help ...
quote: Goran wrote:
YOu didnt declare mciSendString the right way. It should be
| Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer |
My mistake! But when I got everything working I was just happy it finally worked!
Thanks Goran ...
____________________________
people usually just say ... Rimmer your a total git!
|
|
12-04-2006 at 09:02 AM |
|
|
|
|
 |
 |