show file/dir propertie dialog box

TripleB

Active member
Joined
Jul 19, 2004
Messages
38
Location
Belgium
Hellow all,

I would like to show the file/dir properties dialog box in c# .net. The right mousebutton on file/dir properties dialog box you know...
Can I use the built in windows thing of do I have to recreate it my self?

Greetz
 
Recreate it yourself isnt really hard (if you exclude Security and Summary) but the General tab is easily(depend of your knowledge of course) reproduced.

I dont know if you can invoke the one from the OS
 
Yes true... but have got to much to do

Hey Arch4ngel,

I know it isnt hard to recreate, but call me lasy but I just dont feel like putting time in that... I still have more important things to implement and thougth why not take the easy way... if I dont get a positive respons I will recreate it but hopefully it wont be necessary

Greetz
Arch4ngel said:
Recreate it yourself isnt really hard (if you exclude Security and Summary) but the General tab is easily(depend of your knowledge of course) reproduced.

I dont know if you can invoke the one from the OS
 
Hello you all,

for everyone who likes to know the solution this is what i was able to find

greetz

[StructLayout(LayoutKind.Sequential)]
public class SHELLEXECUTEINFO
{
public int cbSize;
public int fMask;
public int hwnd;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpVerb;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpFile;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpParameters;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpDirectory;
public int nShow;
public int hInstApp;
public int lpIDList;
public string lpClass;
public int hkeyClass;
public int dwHotKey;
public int hIcon;
public int hProcess;
}

[DllImport("Shell32.dll", CharSet=CharSet.Auto)]
public static extern int ShellExecuteEx (SHELLEXECUTEINFO shinfo);

private const int SW_SHOW = 5;
private const int SEE_MASK_INVOKEIDLIST = 0x0C;

private void Form1_Load(object sender, System.EventArgs e)
{
SHELLEXECUTEINFO shInfo = new SHELLEXECUTEINFO();

shInfo.cbSize = Marshal.SizeOf(typeof(SHELLEXECUTEINFO));
shInfo.lpFile = @"c:\windows\notepad.exe";
shInfo.nShow = SW_SHOW;
shInfo.fMask = SEE_MASK_INVOKEIDLIST;
shInfo.lpVerb = "properties";

ShellExecuteEx (shInfo);
}
 
Back
Top