shell打开问题
怎么用shell打开一个文件的所在位置? 就对一个程序右键单击查找目标那样..打开文件所有目录位置..(第1个问题)谢谢
还有怎么打开一个可执行文件(包括其他文件)..我打开是找不到文件..我已经给了完整路径啊...(第2个问题)谢谢..
Case 0 是打开可执行文件..(不知道怎么打开)
Case 2 打开文件所有目录位置(就对一个程序右键单击查找目标那样)
代码:
Private Sub Mymenu1_Click(Index As Integer)
Select Case Index
Case 0
Dim File1 As String
File1 = List1.List(List1.ListIndex)
Shell File1, vbNormalFocus
Case 1
Kill List1.List(List1.ListIndex)
List1.LisRemoveItemt1.ListIndex
Case 2
Shell "explorer " & List1.List(List1.ListIndex)
Case 3
List1.Clear
Case 4
Exit Sub
End Select
End Sub
还有怎么打开一个可执行文件(包括其他文件)..我打开是找不到文件..我已经给了完整路径啊...(第2个问题)谢谢..
Case 0 是打开可执行文件..(不知道怎么打开)
Case 2 打开文件所有目录位置(就对一个程序右键单击查找目标那样)
代码:
Private Sub Mymenu1_Click(Index As Integer)
Select Case Index
Case 0
Dim File1 As String
File1 = List1.List(List1.ListIndex)
Shell File1, vbNormalFocus
Case 1
Kill List1.List(List1.ListIndex)
List1.LisRemoveItemt1.ListIndex
Case 2
Shell "explorer " & List1.List(List1.ListIndex)
Case 3
List1.Clear
Case 4
Exit Sub
End Select
End Sub
作者: Near1 发布时间: 2011-06-15
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, "explore", _
"C:\windows", _
vbNullString, vbNullString, 1
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, "explore", _
"C:\windows", _
vbNullString, vbNullString, 1
作者: caozhy 发布时间: 2011-06-15
引用 1 楼 caozhy 的回复:
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As St……
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As St……
那shell怎么打开呢?你这个我试试了可以打开..谢谢这个API函数和shell是不是差不多呢?
作者: Near1 发布时间: 2011-06-15
你可以理解为,shell 是 shellexecute 的简化版。
作者: caozhy 发布时间: 2011-06-15
可以解释下shellexecute 各个参数的意思?..
那为什么我用Shell "explorer " & List1.List(List1.ListIndex) 这样也不行啊..
explorer 我没有加exe啊。。
那为什么我用Shell "explorer " & List1.List(List1.ListIndex) 这样也不行啊..
explorer 我没有加exe啊。。
作者: Near1 发布时间: 2011-06-15