/// <summary> /// 显示文件属性 /// </summary> /// <param name="filename"></param> /// <param name="hwnd"></param> private void ShowProperties(string filename, IntPtr hwnd) { Try(() => { var sei = new ShellExecuteInfo(); sei.cbSize = Marshal.SizeOf(sei); sei.fMask = WindowsAPI.SEE_MASK_NOCLOSEPROCESS | WindowsAPI.SEE_MASK_INVOKEIDLIST | WindowsAPI.SEE_MASK_FLAG_NO_UI; sei.hwnd = hwnd; sei.lpVerb = "properties"; sei.lpFile = filename + "\0\0"; sei.lpParameters = null; sei.lpDirectory = null; sei.nShow = 0; sei.hInstApp = IntPtr.Zero; sei.lpIDList = IntPtr.Zero; WindowsAPI.ShellExecuteEx(ref sei); }); }
public static extern bool ShellExecuteEx(ref ShellExecuteInfo lpExecInfo);