请问怎样在VB6里用win98里的画笔调用一指定文件?

angeltoday 2000-06-26 12:54:00
请问在VB6里怎样用win98里的画笔调用一指定图象文件,并在关闭时用一指定的缺省名保存?谢谢!
...全文
152 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Janven 2000-07-05
  • 打赏
  • 举报
回复

这种方法我经常用,可以的

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 'Declare Function ListView1_ItemClick Lib "MsComctlLib" (ByVal Item As MsComctlLib.ListItem)

ShellExecute 0, "open", "pbrush.EXE", "c:\windows\forest.bmp", "", 3
wgtech 2000-07-05
  • 打赏
  • 举报
回复
最简单的办法:
Shell "start c:\windows\forest.bmp", vbNormalFocus

START.EXE会自动根据文件类型关联调用相关的程序打开。

musicbug 2000-07-02
  • 打赏
  • 举报
回复
可以用WinExec,和ShellExecute函数
ret=WinExec("start c:\windows\forest.bmp",0)
和Shell是一样的
Shell "start c:\windows\forest.bmp",0
ShellExecute(handle, "open", "c:\windows\forest.bmp",0,0, SW_SHOWNORMAL);
handle是调用者的窗口句柄

mafangsan 2000-06-29
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Shell "C:\Program Files\Accessories\MSPAINT.EXE c:\windows\forest.bmp", vbNormalFocus
End Sub
但你必须确定再不同机器上画图的路径
yokel 2000-06-28
  • 打赏
  • 举报
回复
OLE嵌入自然可行.但如是只要实现在VB6里用win98里的画笔调用一指定文件(当然文件必须是画笔可识别的),就不必这么麻烦了!用shell命令就可以了!
Un1 2000-06-26
  • 打赏
  • 举报
回复
使用OLE嵌入。

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧