5

This post: How do I display a file's Properties dialog from C#? describes how to display file's Properties dialog from, I was wondering if it's possible to use same method but set opened tab to securety? From C# code.

See image below.

Folder Properties Security Tab

Thank you in advance.

Community
  • 1
  • 1
Farukh
  • 2,173
  • 2
  • 23
  • 38
  • possible duplicate of [How does one invoke the Windows Permissions dialog programmatically?](http://stackoverflow.com/questions/28035464/how-does-one-invoke-the-windows-permissions-dialog-programmatically) – Christophe Weis Sep 10 '15 at 12:58

1 Answers1

6

Add info.lpParameters = "Security"; to show Security tab.

Or info.lpParameters = "Details"; to show Details tab.

Now ShowFileProperties method is:

    public static bool ShowFileProperties(string Filename)
    {
        SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
        info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
        info.lpVerb = "properties";
        info.lpFile = Filename;
        info.lpParameters = "Security";
        info.nShow = SW_SHOW;
        info.fMask = SEE_MASK_INVOKEIDLIST;
        return ShellExecuteEx(ref info);
    }

Reference: To show the properties page of a file and navigate to a tab

Community
  • 1
  • 1
Behzad
  • 3,502
  • 4
  • 36
  • 63