I'm trying to display the shell's property page for various files and I'm
using this code:
class Win32Shell {
// ... other stuff here
[DllImport("shell32.dll")]
public static extern Int32 ShellExecute(
Int32 hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
Int32 nShowCmd);
// ... other stuff here
}
I use this to open files listed in a listView where the first column is
the filename and the second is the path like so:
ListViewItem lVItem = fileListView.SelectedItems[0];
Win32Shell.ShellExecute(0, "open", fileName,
lVItem.SubItems[1].Text,null, 1);
and it works fine, but when I try to show the properties of said file like
so:
Win32Shell.ShellExecute(0, "properties", fileName,
lVItem.SubItems[1].Text,null, 1);
it returns 31, which means that the action (properties) isn't associated
with said file. This is how it works on all files. I've tried a few
different things to no avail (including two other definitions of
ShellExecute), but none has worked, any ideas?