怎样开启文件属性窗口?????????
怎样开启文件属性窗口????????? 问题点数:100、回复次数:9Top
1 楼Jneu(沧海桑田)回复于 2002-02-09 15:31:53 得分 0
Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As LongTop
2 楼blacklevin(黑闪电)回复于 2002-02-09 15:34:59 得分 10
声明:
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
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Const SEE_MASK_INVOKEIDLIST = &HC
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SEE_MASK_FLAG_NO_UI = &H400
Declare Function ShellExecuteEX Lib "shell32.dll" Alias _
"ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
代码:
' 使用: ShowProps("c:\command.com",Me.hWnd)
Public Sub ShowProps(FileName As String, OwnerhWnd As Long)
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
.cbSize = Len(SEI)
.fMask = SEE_MASK_NOCLOSEPROCESS Or _
SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
.hwnd = OwnerhWnd
.lpVerb = "properties"
.lpFile = FileName
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = 0
End With
r = ShellExecuteEX(SEI)
End SubTop
3 楼sonicdater(事过境迁,除了技术,我什么都没有了)回复于 2002-02-09 18:18:39 得分 20
Public 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
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SW_SHOWNORMAL = 1
Public Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (lpExecInfo As _
SHELLEXECUTEINFO) As Long
Public Const SE_ERR_FNF = 2
Public Const SE_ERR_NOASSOC = 31
Public Declare Function WaitForSingleObject Lib "kernel32.dll" (ByVal hHandle As Long, ByVal _
dwMilliseconds As Long) As Long
Public Const INFINITE = &HFFFF
Public Const WAIT_TIMEOUT = &H102
' *** Place the following code inside window Form1. ***
Private Sub Command1_Click()
Dim sei As SHELLEXECUTEINFO ' structure used by the function
Dim retval As Long ' return value
' Load the information needed to open C:\Docs\readme.txt
' into the structure.
With sei
' Size of the structure
.cbSize = Len(sei)
' Use the optional hProcess element of the structure.
.fMask = SEE_MASK_NOCLOSEPROCESS
' Handle to the window calling this function.
.hwnd = Form1.hWnd
' The action to perform: open the file.
.lpVerb = "open"
' The file to open.
.lpFile = "C:\Docs\readme.txt"
' No additional parameters are needed here.
.lpParameters = ""
' The default directory -- not really necessary in this case.
.lpDirectory = "C:\Docs\"
' Simply display the window.
.nShow = SW_SHOWNORMAL
' The other elements of the structure are either not used
' or will be set when the function returns.
End With
' Open the file using its associated program.
retval = ShellExecuteEx(sei)
If retval = 0 Then
' The function failed, so report the error. Err.LastDllError
' could also be used instead, if you wish.
Select Case sei.hInstApp
Case SE_ERR_FNF
Debug.Print "The file C:\Docs\readme.txt was not found."
Case SE_NOASSOC
Debug.Print "No program is associated with *.txt files."
Case Else
Debug.Print "An unexpected error occured."
End Select
Else
' Wait for the opened process to close before continuing. Instead
' of waiting once for a time of INFINITE, this example repeatedly checks to see if the
' is still open. This allows the DoEvents VB function to be called, preventing
' our program from appearing to lock up while it waits.
Do
DoEvents
retval = WaitForSingleObject(sei.hProcess, 0)
Loop While retval = WAIT_TIMEOUT
Debug.Print "Notepad (or whatever program was opened) has just closed."
End If
End SubTop
4 楼tg123(T.G.)回复于 2002-02-09 18:50:46 得分 10
Const SEE_MASK_INVOKEIDLIST = &HC
Const SEE_MASK_NOCLOSEPROCESS = &H40
Const SEE_MASK_FLAG_NO_UI = &H400
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
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
Sub ShowProps(FileName As String, OwnerhWnd As Long)
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
'Set the structure's size
.cbSize = Len(SEI)
'Seet the mask
.fMask = SEE_MASK_NOCLOSEPROCESS Or _
SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
'Set the owner window
.hwnd = OwnerhWnd
'Show the properties
.lpVerb = "properties"
'Set the filename
.lpFile = FileName
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = 0
End With
r = ShellExecuteEX(SEI)
End Sub
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
ShowProps "c:\config.sys", Me.hwnd
End Sub
Top
5 楼minglx(我会给你分)回复于 2002-02-09 21:46:44 得分 0
选中文件,按右键,再选取“属性”
哈~~~!!Top
6 楼asciiman(MS、周杰伦一个不能少!)回复于 2002-02-09 22:21:59 得分 0
同Tg123(T.G.)Top
7 楼tianxiaolei(辛武)回复于 2002-02-10 14:11:01 得分 60
开启文件属性窗口
声明:
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
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Const SEE_MASK_INVOKEIDLIST = &HC
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SEE_MASK_FLAG_NO_UI = &H400
Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
代码:
' 使用: ShowProps("c:\command.com",Me.hWnd)
Public Sub ShowProps(FileName As String, OwnerhWnd As Long)
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
.cbSize = Len(SEI)
.fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
.hwnd = OwnerhWnd
.lpVerb = "properties"
.lpFile = FileName
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = 0
End With
r = ShellExecuteEX(SEI)
End Sub
Top
8 楼john_christopher(释)回复于 2002-02-10 14:37:33 得分 0
这里的给分制度弄的我很胡涂Top
9 楼FUNDGIRL(阿弥陀佛(别抢我分,谢谢))回复于 2002-02-13 11:23:49 得分 0
分分~Top




