?? vb14.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0057)http://www.pconline.com.cn/experience/subject/VB/vb14.htm -->
<HTML><HEAD><TITLE>|><| 太平洋電腦信息網</TITLE><!-- #BeginTemplate "/Templates/0723.dwt" --><!-- #BeginEditable "doctitle" --><!-- #EndEditable -->
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK
href="vb14.files/text.css" rel=stylesheet>
<STYLE type=text/css>.sfont {
LINE-HEIGHT: 18pt
}
</STYLE>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top width="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgColor=#303880>
<TD><A href="http://www.pconline.com.cn/"><IMG alt=太平洋電腦信息網 border=0
height=18 hspace=30 src="vb14.files/txtpconline.gif"
width=96></A><IMG height=10 src="vb14.files/blank.gif"
width=400></TD></TR></TBODY></TABLE></TD>
<TD align=right background=vb14.files/bw.gif noWrap width=130><IMG
height=26 src="vb14.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/sitemap/"><IMG alt=網站地圖 border=0
height=26 src="vb14.files/sitemap.gif" width=21></A><IMG height=26
src="vb14.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/"><IMG alt=關于太平洋 border=0 height=26
src="vb14.files/aboutus.gif" width=21></A><IMG height=26
src="vb14.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/tariff.html"><IMG alt=與我們聯系 border=0
height=26 src="vb14.files/contact.gif" width=21></A><IMG height=26
src="vb14.files/bw.gif" width=10></TD></TR></TBODY></TABLE><BR>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD bgColor=#666666><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD> </TD>
<TD colSpan=2 noWrap><A
href="http://www.pconline.com.cn/experience/index.html"><IMG
align=absBottom alt=企業之窗 border=0 height=15
src="vb14.files/txtexperience.gif" width=68></A> <A
href="http://www.pconline.com.cn/">首 頁</A> <A
href="http://www.pconline.com.cn/market/">今日報價</A> <A
href="http://www.pconline.com.cn/recommend/">產品推介</A> <A
href="http://www.pconline.com.cn/yp/">企業之窗</A> <A
href="http://www.pconline.com.cn/news/">科技新聞</A> <A
href="http://www.pconline.com.cn/product/">產品查詢</A> <A
href="http://www.pconline.com.cn/download/">軟件下載</A></TD></TR>
<TR>
<TD><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb14.files/blank.gif" width=21></TD>
<TD bgColor=#ffa000 colSpan=2><IMG height=1 src="vb14.files/blank.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD bgColor=#cdcdcd><IMG height=5 src="vb14.files/blank.gif" width=1></TD>
<TD align=right colSpan=3><IMG height=6 src="vb14.files/ffa000.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb14.files/blank.gif" width=1></TD>
<TD align=right><A href="http://www.pconline.com.cn/"><IMG alt=太平洋電腦信息網
border=0 height=35 src="vb14.files/pconline.com.cn.gif" vspace=10
width=162></A></TD>
<TD> </TD>
<TD vAlign=bottom><!-- #BeginEditable "important_news" --><IMG height=40
src="vb14.files/blank.gif" width=350><!-- #EndEditable --></TD>
<TD align=right vAlign=top><!-- #BeginEditable "adv_top" --><IMG alt=廣告位
height=43 src="vb14.files/icon.gif"
width=190><!-- #EndEditable --></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb14.files/blank.gif"
width=1></TD>
<TD vAlign=top width=170><!-- #BeginEditable "addons" --><!--替代為附加信息 --><!-- #EndEditable --></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb14.files/blank.gif"
width=1></TD>
<TD><IMG height=1 src="vb14.files/blank.gif" width=21></TD>
<TD colSpan=3 vAlign=top width=566><!-- #BeginEditable "1" --><IMG
height=1 src="vb14.files/blank.gif" width=566><BR><IMG height=1
src="vb14.files/666666.gif" width=420><BR><IMG height=13
src="vb14.files/blank.gif" width=1><A
href="http://www.pconline.com.cn/experience/">經驗共享</A> > <SPAN
class=greenb><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">專題教程</A></SPAN><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">
VB專區</A>> <BR><IMG height=1 src="vb14.files/666666.gif" vspace=1
width=420><BR>
<P><B><FONT color=#000066><SPAN class=sfont>用VB 設 計VCD 播 放
器</SPAN></FONT></B> </P>
<P><SPAN class=sfont>傅 能 紅 </SPAN></P>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 本 人 在 電 腦 報 上 發 現 一 個
非 常 實 用 的VB 小 程 序 經 過 一 定 的 修 改 后, 不 敢 獨 享, 奉 獻 給 諸 位。 </SPAN>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 該 程 序 通 過VB 的 多 媒 體 控
件MCI32.OCX 可 以 打 開MPEG 壓 縮 文 件( 如VCD2.0 版 的.DAT 文 件) 來 實 現 一 個VCD 播 放 器 的
設 計 </SPAN>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 首 先 必 須 確 保 在 你
的Windows 系 統 中SYSTEM.INI 文 件 關 于[MCI] 中 需 有MPEGVideo 項( 一 般Windows 95
和Windows 98 中 均 有 此 項) 。 </SPAN>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 其 次 在VB 中 建 立 一 個 新 窗
口, 加 入 多 媒 體 部 件Microsoft Multimedia Control 5.0( 位
于C:\Windows\System\MCI32.OCX), 以 及 對 話 框 部 件 Microsoft Common Dialog
Control 5.0( 位 于C:\Windows\System\COMMONDLG32.OCX), 將MCI 控 件 拖 放 至 窗 體Form
上, 調 整 其 大 小, 并 將 窗 體 的 大 小 也 調 整 為 與 其 同 樣 大 小; 將 其 九 個 按 鈕( 從 左 至 右
為:Prev、Next、Play、Pause、Back、Step、Stop、Record 和 Eject) 中 的Record 按 鈕
的Visible 屬 性 設 為False, 其 余 按 鈕 中 的Visible 屬 性 和Enabled 屬 性 設 為True , 以 上 按
鈕 的 設 置 可 通 過MMControl 的 屬 性 欄 內" 自 定 義" 項 來 設 置。 對 話 框 控 件 的DefaultExt 屬
性 設 為.DAT, DialogTitle 屬 性 設 為" 打 開 多 媒 體 文 件", Filter 屬 性 設 為"*.DAT,
*.WAV", InitDir 屬 性 設 為"G:\MPEGAV"( 假 設 光 驅 盤 符 為G) 。 </SPAN>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 源 代 碼 如 下: </SPAN><PRE><SPAN class=sfont>
Option Explicit
Private Sub Form_Load()
Dim Response As Integer
MMControl1.DeviceType = "MPEGVideo"
CommonDialog1.ShowOpen
'通過對話框選擇不同的VCD文件
MMControl1.filename = CommonDialog1.filename
'選定要播放的文件
MMControl1.Command = "Open"
MMControl1.Command = "Play"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MMControl1.Command = "close"
End Sub
Private Sub MMControl1_BackClick(Cancel As Integer)
'對Back按鈕的功能改進
Dim i As Integer
i = MMControl1.Position - 100
'數值100為后退量,可適當調整
If i < 0 Then
MMControl1.From = 0
Else
MMControl1.From = i
End If
MMControl1.Command = "Play"
End Sub
Private Sub MMControl1_StepClick(Cancel As Integer)
'對Step按鈕的功能改進
Dim j As Integer
j = MMControl1.Position + 100
'數值100為前進量,可適當調整
If j > MMControl1.Length Then
MMControl1.From = MMControl1.Length
Else
MMControl1.From = j
End If
MMControl1.Command = "Play"
End Sub
</SPAN></PRE>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> MCI 控 件 還 有 很 多 屬 性,
如 畫 面 播 放 位 置hWndDisplay 屬 性 等 等, 大 家 可 參 閱 相 關 資 料 自 行 摸 索。 </SPAN>
<P><SPAN class=sfont><FONT color=#ffffff>----</FONT> 調 整 好 窗 體 的 標 題、 圖 標、
顏 色 等, 然 后 編 譯 成 .EXE 文 件, 你 就 可 以 在Windows 下 擁 有 自 己 的VCD 播 放 器 了。
</SPAN>
<P align=right><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">----更多的文章</A>
<!-- #EndEditable --></P></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb14.files/blank.gif"
width=1></TD>
<TD align=right vAlign=bottom width=170><IMG height=10
src="vb14.files/blank.gif" width=170><BR></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb14.files/blank.gif"
width=1></TD>
<TD width=21><IMG height=1 src="vb14.files/blank.gif" width=21></TD>
<TD bgColor=#eeeeee width=566><IMG height=10 src="vb14.files/blank.gif"
width=566><BR>版權所有©1999 太平洋電腦信息網<BR><FONT
face="Arial, Helvetica, sans-serif"><A
href="mailto:exp@pconline.com.cn">exp@pconline.com.cn</A></FONT> <IMG
height=1 src="vb14.files/hhvisit.html" width=1> </TD></TR></TBODY></TABLE><!-- #EndTemplate --></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -