这是部分代码,用来播放rm格式的视频,但是在每次播放的开始总是不断的闪烁,播放窗口是黑色的,用鼠标点中状态栏拖动下播放所在的窗口就可以了,我想让它自动的重新播放,大侠帮忙!!!
Public Function 函数_播放_RM(Filename_1 As String) As Long
Dim s As String
Dim ShortFileName_1 As String
Dim Ret As Long
Dim Length_Start_1 As Long
Dim Length_End_1 As Long
Dim mciCommand As String
Dim lltemp1 As Long
Dim lltemp2 As Long
Dim sstemp1 As String * 255
#If DEBUG_ERROR Then
On Error Resume Next
#End If
函数_播放_RM = 0
变量_播动画_Picture.CurrentX = 0
变量_播动画_Picture.CurrentY = 0
Call 函数_设定窗口宽及高_1(变量_窗口的宽, 变量_窗口的高, 变量_播动画_Picture)
Call 函数_设定窗口宽及高_1(变量_窗口的宽, 变量_窗口的高, 变量_播动画_Picture_5)
FormB1.RealAudio1.Move 0, 0
变量_播动画_Picture_5.Move 0, 0
变量_播动画_Picture_5.ZOrder 0
FormB1.RealAudio1.ZOrder 0
Call 函数_初始_RealAudio(FormB1.RealAudio1, Filename_1)
If Not FormB1.RealAudio1.CanPlay Then
GoTo Exit_1
End If
DoEvents
FormB1.RealAudio1.Visible = True
变量_播动画_Picture_5.Visible = True
变量_播动画_Picture_5.Refresh
FormB1.RealAudio1.DoPlay
Do While (True)
DoEvents
If FormB1.RealAudio1.GetPlayState <> 3 Then
Exit Do
End If
If 变量_停止播动画_1 Then Exit Do
If 变量_播放日期_致能 Then Call 函数_播放今天日期
If 变量_停止播动画_1 Then Exit Do
If 变量_播放时间_数字式_致能 Or 变量_播放时间_指针式_致能 Then Call 函数_播放今天时间
If 变量_停止播动画_1 Then Exit Do
If 变量_观看目前正在播放的档名 Then
If Not 变量_观看目前正在播放的档名_1 Then
变量_观看目前正在播放的档名_1 = True
Call 函数_传送目前正在播放的档名及结果_1(&H5, 变量_动画档_档名_2)
End If
End If
Exit_1:
If Not (FormB1.RealAudio1 Is Nothing) Then
FormB1.RealAudio1.DoStop
变量_播动画_Picture_5.Visible = False
FormB1.RealAudio1.Visible = False
End If
End Function
Private Sub 函数_初始_RealAudio(RealAudio_1 As RealAudio, Filename_1 As String)
RealAudio_1.DoStop
RealAudio_1.AutoStart = False
RealAudio_1.SetSource (Filename_1)
RealAudio_1.AutoStart = False
RealAudio_1.SetMute (True)
RealAudio_1.Visible = False
End Sub