Home > Software engineering >  (turn) the problem of video playback
(turn) the problem of video playback

Time:10-19

Recently to do a thing to start playing automatically after a period of video, and then the black screen, waiting for the press the keyboard keys, p again start playing video, play the black screen, repeat, I wrote a, can only be implemented after pinot, behind the buttons don't know where to put in operation, please help, thank you! The code is as follows:
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal HWND _
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long As Any)
'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Const WM_SYSCOMMAND=& amp; H112 & amp;
Const SC_MONITORPOWER=& amp; HF170 & amp;
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim edata As Integer

Private Sub Form_KeyPress (KeyAscii As Integer)
If keycode=vbKeyP Then
MCIWnd1. FileName=CommonDialog1. FileName
CommonDialog1. FileName="F: \ zm \ FFTEY9GG6MPCY4F WMV" 'CommonDialog1. The FileName
MCIWnd1. Position=MCIWnd1. Start
MCIWnd1.Com mand="Play"
End the If
End Sub

Private Sub Form_Load ()
MCIWnd1. Left=Form1. ScaleLeft
MCIWnd1. Top=Form1. ScaleTop
MCIWnd1. Width=Screen. Width 'Form1. ScaleWidth
MCIWnd1. Height=Screen. Height 'Form1. ScaleHeight
MCIWnd1.Com mand="Close"
'CommonDialog1. Action=1
MCIWnd1. FileName=CommonDialog1. FileName
CommonDialog1. FileName="F: \ zm \ FFTEY9GG6MPCY4F WMV" 'CommonDialog1. The FileName
MCIWnd1.Com mand="Play"
End Sub

Private Sub Form_Resize ()
MCIWnd1. Left=Form1. ScaleLeft
MCIWnd1. Top=Form1. ScaleTop
MCIWnd1. Width=Screen. Width 'Form1. ScaleWidth
MCIWnd1. Height=Screen. Height 'Form1. ScaleHeight
End Sub


Private Sub MCIWnd1_PositionChange (ByVal Position As Long)
If MCIWnd1. Position=MCIWnd1. Length Then
SendMessage Me. HWND WM_SYSCOMMAND SC_MONITORPOWER, ByVal 2 & amp; 'off display
End the If
End Sub

CodePudding user response:

With the keyboard hook to define hotkeys:
http://topic.csdn.net/u/20110307/14/dff9d358-adfc-4871-a053-f698f28487fc.html

CodePudding user response:

Ok, thank you! Haven't learned, a lot of definitions are totally do not understand, to understand,

CodePudding user response:

These two days are doing VB video player
Rookie encountered many problems
LZ source can share?
409223171 @qq.com
Thank you for

CodePudding user response:

Look at the flash control properties

CodePudding user response:

Thank you very much! Haven't learned, a lot of definitions are completely don't understand
  • Related