468,761 Members | 1,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,761 developers. It's quick & easy.

detailed file information (not icon) using shell32 pinvoke

I've seen many examples of how to call SHGetFileInfo in shell32.dll to get a
files associated icon, but I can't find anywhere how to get the file
information (size, last date modified, etc, etc) out of shell32 using pinvoke.

I have however seen how to get this information using COM:
Shell32.Shell shell = new Shell32.ShellClass();
Shell32.Folder folder = shell.NameSpace("C:\\");
Shell32.FolderItem folderItem = folder.ParseName("test.doc");

but can you get this using pinvoke? If not, is it bad to use both COM and
pinvoke at the same time?
Nov 16 '05 #1
2 3105
but I can't find anywhere how to get the file
information (size, last date modified, etc, etc) out of shell32 using pinvoke.


The File and FileInfo classes in the System.IO namespace can provide
that information. No P/Invoking needed.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
Incidentally check out pinvoke.net anytime you have doubts about whether or
not to use a dll export. They have a very neat VS add-in too.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
but I can't find anywhere how to get the file
information (size, last date modified, etc, etc) out of shell32 using
pinvoke.


The File and FileInfo classes in the System.IO namespace can provide
that information. No P/Invoking needed.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Grant Edwards | last post: by
6 posts views Thread by Brian Henry | last post: by
reply views Thread by Jack Orenstein | last post: by
4 posts views Thread by Neo | last post: by
reply views Thread by Dick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.