fork download
  1. class ShellFileProperty
  2. {
  3. private const int SW_SHOW = 5;
  4. private const uint SEE_MASK_INVOKEIDLIST = 12;
  5. [DllImport("shell32.dll", CharSet = CharSet.Auto)]
  6. static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);
  7.  
  8. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
  9. public struct SHELLEXECUTEINFO
  10. {
  11. public int cbSize;
  12. public uint fMask;
  13. public IntPtr hwnd;
  14. [MarshalAs(UnmanagedType.LPTStr)]
  15. public string lpVerb;
  16. [MarshalAs(UnmanagedType.LPTStr)]
  17. public string lpFile;
  18. [MarshalAs(UnmanagedType.LPTStr)]
  19. public string lpParameters;
  20. [MarshalAs(UnmanagedType.LPTStr)]
  21. public string lpDirectory;
  22. public int nShow;
  23. public IntPtr hInstApp;
  24. public IntPtr lpIDList;
  25. [MarshalAs(UnmanagedType.LPTStr)]
  26. public string lpClass;
  27. public IntPtr hkeyClass;
  28. public uint dwHotKey;
  29. public IntPtr hIcon;
  30. public IntPtr hProcess;
  31. }
  32.  
  33.  
  34. public static void ShowDialog( string Filename)
  35. {
  36. var info = new SHELLEXECUTEINFO();
  37. info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
  38. info.lpVerb = "properties";
  39. info.lpFile = Filename;
  40. info.nShow = SW_SHOW;
  41. info.fMask = SEE_MASK_INVOKEIDLIST;
  42. ShellExecuteEx(ref info);
  43. }
  44. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty