Private 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
Const ATTR_NORMAL = 0
Const ATTR_READONLY = 1
Const ATTR_HIDDEN = 2
Const ATTR_SYSTEM = 4
Const ATTR_VOLUME = 8
Const ATTR_DIRECTORY = 16
Const ATTR_ARCHIVE = 32
Dim read As String
Dim rea As String
Private Sub Command1_Click()
Call ShellExecute(hwnd, "Open", read, "", App.Path, 1)
dumai.Hide
End Sub
Private Sub Command2_Click()
Call ShellExecute(hwnd, "Open", rea, "", App.Path, 1)
dumai.Hide
End Sub
Private Sub Form_Load()
read = App.Path & "\shelltst.txt"
rea = App.Path & "\menu.pdf"
dumai.WindowState = 2
End Sub
CommonDialog1.DefaultExt = "*.txt"
CommonDialog1.FileName = "*.txt"
CommonDialog1.DialogTitle = "打开文件... "
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
If Err Then Exit Sub
'选择欲备份的数据库文件
tmp_filed = CommonDialog1.FileName
If tmp_filed = "" Then Exit Sub
If Dir(tmp_filed) = "" Then
MsgBox "文件:" & tmp_filed & " 没有找到文件!", vbExclamation
Exit Sub
End If
Private 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
Private Sub Command1_Click()
RetVal = Shell("readme.TXT", 1)
End Sub