In XP, I was able to show the File Properties dialog from c# code. The essential bits are shown below;
This no longer works in Windows 7 64 bit. Surely it must be implemented more simply now?
I have searched the internet for a replacement method without success.
I noticed that the DllImport refers to shell32.dll, is there a replacement for Windows 7, 64 bit?
private void ShowFileProperties(string fileName, string verbName)
{
SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
info.lpVerb = verbName;
info.lpFile = fileName;
info.nShow = SW_SHOW;
info.fMask = SEE_MASK_INVOKEIDLIST;
ShellExecuteEx(ref info);
}
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct SHELLEXECUTEINFO
{
public int cbSize;
public uint fMask;
public IntPtr hwnd;
[MarshalAs(UnmanagedType.LPTStr)]
public String lpVerb;
[MarshalAs(UnmanagedType.LPTStr)]
public String lpFile;
[MarshalAs(UnmanagedType.LPTStr)]
public String lpParameters;
[MarshalAs(UnmanagedType.LPTStr)]
public String lpDirectory;
public int nShow;
public int hInstApp;
public int lpIDList;
[MarshalAs(UnmanagedType.LPTStr)]
public String lpClass;
public int hkeyClass;
public uint dwHotKey;
public int hIcon;
public int hProcess;
}