请问VB如何可以实现全屏播放一个avi文件,然后打开一个HTML文件呢?请指教,谢谢!

qianghui 2004-05-07 04:05:18
请问VB如何可以实现全屏播放一个avi文件,然后打开一个HTML文件呢?请指教,谢谢!
...全文
17 3 点赞 打赏 收藏 举报
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
kmzs 2004-05-11
就是这样吧
  • 打赏
  • 举报
回复
zlg8616 2004-05-11
给你一个例子也许有用,但我自己也是新手!!!!!
如果实现了全屏也请给我发一份zlg8616@163.com 谢谢!!


我每当看一张多媒体光盘时,都会被其中的一些数字电影所折倒。现在有了MCI我们也可以播放AVI动画了,并且并不他们的差。其源程序如下:

VERSION 5.00

Begin VB.Form AVI

Appearance = 0 'Flat

BackColor = &H00FFFFFF&

Caption = "AVI播放器 "

ClientHeight = 2700

ClientLeft = 3105

ClientTop = 3405

ClientWidth = 4710

ForeColor = &H80000008&

LinkTopic = "Form1"

PaletteMode = 1 'UseZOrder

ScaleHeight = 180

ScaleMode = 3 'Pixel

ScaleWidth = 314

WindowState = 2 'Maximized

End

Attribute VB_Name = "AVI"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Option Explicit

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

Private Sub Form_Click()

PlayVideo "f:\2.avi", AVI.hWnd

End

End Sub

Private Function Mcistring(commandstring As String) As String

Dim returnstring As String * 256

Dim dummy As Integer

dummy = mciSendString(commandstring, returnstring, 255, 0)

Mcistring = returnstring

End Function

Private Sub PlayVideo(FileName As String, ByVal hWindow As Integer)

Dim commandstring As String

Dim pstring As String * 255

'打开AVI设备

commandstring = "Open " & FileName & " alias AVI"

pstring = Mcistring(commandstring)

'设置输出窗口

commandstring = "Window AVI handle " & Str$(hWindow)

pstring = Mcistring(commandstring)

'定义全屏

commandstring = "Put AVI destination at 0 0 640 480"

'读者不妨试试改改字符串中0 0 648 480 几个字符,你会大吃一惊的!但要注意字符之 间要有空格。(显示模式为:640*480)

pstring = Mcistring(commandstring)

'播放AVI

MousePointer = 11

commandstring = "Play AVI wait "

pstring = Mcistring(commandstring)

MousePointer = 0

'关闭AVI设备

commandstring = "Close AVI"

pstring = Mcistring(commandstring)

End Sub
  • 打赏
  • 举报
回复
goodname008 2004-05-09
用mciSendString函数加上MCI指令集可以实现全屏播放avi文件。
打开html文件可以用ShellExecute函数。
  • 打赏
  • 举报
回复
相关推荐
发帖
多媒体
加入

807

社区成员

VB 多媒体
申请成为版主
帖子事件
创建了帖子
2004-05-07 04:05
社区公告
暂无公告