Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can we obtain the PIDLs of some files in a folder, if we got the IShellFolder Interface of that folder?

I used IShellFolder::GetAttributesOf Method, but it doesn't work. Is there any mistake in the following code? Please suggest.


ShellLib.IShellFolder pShellFolder;
phellFolder = ShellLib.ShellFunctions.GetDesktopFolder();
IntPtr pidlRoot;
ShellLib.ShellApi.SHGetFolderLocation( IntPtr.Zero, (short)ShellLib.ShellApi.CSIDL.CSIDL_SYSTEM, IntPtr.Zero,0,out pidlRoot);

IntPtr[] arry ={ };
uint rgf = 0;
pShellFolder.GetAttributesOf(1, arry, ref rgf);
Posted

1 solution

Go here to learn how to use it correctly:

http://www.pinvoke.net/default.aspx/shell32/SHGetFolderLocation.html[^]

After that, use google to find examples of using it in C#. I'm sure that if you actually use the debugger provided in Visual Studio, you'll be able to find out what it's returning to you, and you can make the necessary adjustments to your code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900