Public Structure SHELLEXECUTEINFO Public cbSize As Integer Public fMask As Integer Public hwnd As IntPtr <MarshalAs(UnmanagedType.LPTStr)> Public lpVerb As String <MarshalAs(UnmanagedType.LPTStr)> Public lpFile As String <MarshalAs(UnmanagedType.LPTStr)> Public lpParameters As String <MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String Dim nShow As Integer Dim hInstApp As IntPtr Dim lpIDList As IntPtr <MarshalAs(UnmanagedType.LPTStr)> Public lpClass As String Public hkeyClass As IntPtr Public dwHotKey As Integer Public hIcon As IntPtr Public hProcess As IntPtr End Structure Public Const SW_SHOW As Short = 5 Public Const SEE_MASK_NOCLOSEPROCESS As Short = 64 Public Const SEE_MASK_INVOKEIDLIST As Short = 12 Public Const SEE_MASK_FLAG_NO_UI As Short = 1024 <DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _ Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean End Function Dim sei As New SHELLEXECUTEINFO sei.cbSize = Marshal.SizeOf(sei) sei.lpVerb = "properties" sei.lpFile = "你要显示属性的文件路径" sei.nShow = SW_SHOW sei.fMask = SEE_MASK_NOCLOSEPROCESS or SEE_MASK_INVOKEIDLIST or SEE_MASK_FLAG_NO_UI ShellExecuteEx(sei)
通过API调用文件的属性对话框
最新推荐文章于 2023-04-14 19:55:51 发布