当前位置: 网学 > 编程文档 > VB > 正文

ShellExecute API应用整理

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式

作者: yanek

1.  执行“打开“,“查找“,“资源管理器“和”打印“
必要的声明:
'' nShowCmd
Public Const SW_HIDE = 0
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_RESTORE = 9

'' Error Code
Public Const ERROR_FILE_NOT_FOUND = 2
Public Const ERROR_PATH_NOT_FOUND = 3
Public Const ERROR_BAD_FORMAT = 11

Public Const SE_ERR_FNF = 2
Public Const SE_ERR_PNF = 3
Public Const SE_ERR_ACCESSDENIED = 5
Public Const SE_ERR_OOM = 8
Public Const SE_ERR_SHARE = 26
Public Const SE_ERR_ASSOCINCOMPLETE = 27
Public Const SE_ERR_DDETIMEOUT = 28
Public Const SE_ERR_DDEFAIL = 29
Public Const SE_ERR_DDEBUSY = 30
Public Const SE_ERR_NOASSOC = 31
Public Const SE_ERR_DLLNOTFOUND = 32

Public 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



“打开“操作
            ShellExecute Me.hwnd, "open", _
                    Text1.Text, _
                    vbNullString, vbNullString, _
                    SW_SHOWNORMAL


“查找“操作
        ShellExecute Me.hwnd, "find", _
                LocalDir, _
                vbNullString, vbNullString, _
                SW_SHOWNORMAL


“打印“操作
            ShellExecute Me.hwnd, "print", _
                    Text1.Text, _
                    vbNullString, vbNullString, _
                    SW_SHOWNORMAL


“资源管理器“
        ShellExecute Me.hwnd, "explore", _
 &nbs
  • 下一篇资讯: 关于VB与OFFICE的配合
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号