📄 shellwaitapi.bas
字号:
Attribute VB_Name = "ShellWaitApi"
Option Explicit
Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hWnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Sub ShellWait(FileName As String, WorkDir As String, strParameters As String)
Dim ShExecInfo As SHELLEXECUTEINFO
ShExecInfo.cbSize = Len(ShExecInfo)
ShExecInfo.fMask = &H40
ShExecInfo.hWnd = frmMain.hWnd
ShExecInfo.lpVerb = "open"
ShExecInfo.lpFile = FileName
ShExecInfo.lpParameters = strParameters
ShExecInfo.lpDirectory = WorkDir
ShExecInfo.nShow = 1
ShExecInfo.hInstApp = vbNull
Call ShellExecuteEx(ShExecInfo)
Call WaitForSingleObject(ShExecInfo.hProcess, &HFFFF)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -