2个回答
展开全部
使用资源管理器呗
点 外接程序--外接程序管理器 在打开的对话框里点“Visual Basic 6 资源编辑器”再把“加载/卸载”打上勾就有了。 工具栏会多出一个资源编辑器
如果没有找到“Visual Basic 6 资源编辑器”说明你的VB是精简版的。必须下载完整的版本才行。
==================================================
所谓资源文件其实就是在生成的EXE文件的最后部分写入你添加的图片、文本等等一系列资源,运行时,你的程序就可以读取这些东西。
如果从文件读取的话,你就必须在提供EXE文件的同时提供你要读取的文件,而用资源文件,你就可以只有一个EXE文件了。
参考代码:
'声明API
private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Const HWND_TOP = 0
Const GW_CHILD = 5
Dim SW As Long
Private Sub Form_Load()
'度量单位设为像素
Me.ScaleMode = vbPixels
'初始化MCI,并打开文件
MMControl1.DeviceType = "MPEGVideo"
MMControl1.FileName = "D:intro.wmv"
MMControl1.Command = "open"
'打开MCI后,取MCI显示输出的窗口的句柄
SW = FindWindow("MCIQTZ_Window", MMControl1.FileName)
'取子窗口句柄
SW = GetWindow(SW, GW_CHILD)
'将MCI显示输出窗口(子窗口)置于当前窗口中
MMControl1.hWndDisplay = Me.hwnd
MMControl1.Command = "play"
End Sub
Private Sub Form_Resize()
'设置子窗口自动适应当前窗口
SetWindowPos SW, HWND_TOP, Me.ScaleLeft, Me.ScaleTop, Me.ScaleWidth, Me.ScaleHeight, 0&
End Sub
注:MMControl1 是微软的mediaplay控件
点 外接程序--外接程序管理器 在打开的对话框里点“Visual Basic 6 资源编辑器”再把“加载/卸载”打上勾就有了。 工具栏会多出一个资源编辑器
如果没有找到“Visual Basic 6 资源编辑器”说明你的VB是精简版的。必须下载完整的版本才行。
==================================================
所谓资源文件其实就是在生成的EXE文件的最后部分写入你添加的图片、文本等等一系列资源,运行时,你的程序就可以读取这些东西。
如果从文件读取的话,你就必须在提供EXE文件的同时提供你要读取的文件,而用资源文件,你就可以只有一个EXE文件了。
参考代码:
'声明API
private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Const HWND_TOP = 0
Const GW_CHILD = 5
Dim SW As Long
Private Sub Form_Load()
'度量单位设为像素
Me.ScaleMode = vbPixels
'初始化MCI,并打开文件
MMControl1.DeviceType = "MPEGVideo"
MMControl1.FileName = "D:intro.wmv"
MMControl1.Command = "open"
'打开MCI后,取MCI显示输出的窗口的句柄
SW = FindWindow("MCIQTZ_Window", MMControl1.FileName)
'取子窗口句柄
SW = GetWindow(SW, GW_CHILD)
'将MCI显示输出窗口(子窗口)置于当前窗口中
MMControl1.hWndDisplay = Me.hwnd
MMControl1.Command = "play"
End Sub
Private Sub Form_Resize()
'设置子窗口自动适应当前窗口
SetWindowPos SW, HWND_TOP, Me.ScaleLeft, Me.ScaleTop, Me.ScaleWidth, Me.ScaleHeight, 0&
End Sub
注:MMControl1 是微软的mediaplay控件
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询