Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

 

I don't know if you can invoke the one from the OS

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

Yes true... but have got to much to do

 

Hey Arch4ngel,

 

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

 

Greetz

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

 

I don't know if you can invoke the one from the OS

Posted

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);

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...