how to get the type of the file selected......
-
hi .... im workin on a windows app.... i want to list my contents in detail... like i wanna display the name, size, type and last modified ... i've got the rest how to get the type of the file used.... for eg: if a folder is choosed the type for it is file folder i dont want the extension to be displayed as the type i want the real type of the file used.... im tryin with fileinfo object ... am i missing any thing specific.... imsathy
-
hi .... im workin on a windows app.... i want to list my contents in detail... like i wanna display the name, size, type and last modified ... i've got the rest how to get the type of the file used.... for eg: if a folder is choosed the type for it is file folder i dont want the extension to be displayed as the type i want the real type of the file used.... im tryin with fileinfo object ... am i missing any thing specific.... imsathy
If you suspect the extension could be wrong, then you need to parse the file. Which means writing code for every file format you want to support. Christian Graus - Microsoft MVP - C++
-
If you suspect the extension could be wrong, then you need to parse the file. Which means writing code for every file format you want to support. Christian Graus - Microsoft MVP - C++
-
*sigh* Christian Graus - Microsoft MVP - C++
-
*sigh* Christian Graus - Microsoft MVP - C++
*grin* I try to answer whatever I can, but don't meet with much success as I'm a tyro myself; but I do see most of your replies. I really feel for you when you get such questions. :) Cheers, Vikram.
"Don't judge me You could be me in another life In another set of circumstances" - "Tomorrow we'll see", Sting.
-
hi .... im workin on a windows app.... i want to list my contents in detail... like i wanna display the name, size, type and last modified ... i've got the rest how to get the type of the file used.... for eg: if a folder is choosed the type for it is file folder i dont want the extension to be displayed as the type i want the real type of the file used.... im tryin with fileinfo object ... am i missing any thing specific.... imsathy
Hi! Could it be that your question has been misinterpreted? Do you want to determine the type of file from the contents of the file because you don't trust the extension (like CG suggested) or do you want to display the name for a given extension like Windows Explorer does (for example: extension is ".txt", but explorer shows "text file")? Regards, mav -- Black holes are the places where god divided by 0...
-
Hi! Could it be that your question has been misinterpreted? Do you want to determine the type of file from the contents of the file because you don't trust the extension (like CG suggested) or do you want to display the name for a given extension like Windows Explorer does (for example: extension is ".txt", but explorer shows "text file")? Regards, mav -- Black holes are the places where god divided by 0...
-
mav.northwind wrote:
want to display the name for a given extension like Windows Explorer does (for example: extension is ".txt", but explorer shows "text file")?
this is exactly wat i want!!! sathy
That's an information you get (along with the icon associated, btw.) from a call to
SHGetFileInfo
from shell32.dll. Take a look at this article[^], it holds all the information you need. Regards, mav -- Black holes are the places where god divided by 0... -
That's an information you get (along with the icon associated, btw.) from a call to
SHGetFileInfo
from shell32.dll. Take a look at this article[^], it holds all the information you need. Regards, mav -- Black holes are the places where god divided by 0...mav.northwind wrote:
That's an information you get (along with the icon associated, btw.) from a call to SHGetFileInfo from shell32.dll.
i dont want icon inforamtion tht i have already done. wat i want is if a "test.doc" file is selected i want the type as Microsoft Word Document the details for this one is in shlwapi.dll but the same is working for me in vb.net but i want it in c# .. its not working sathy
-
mav.northwind wrote:
That's an information you get (along with the icon associated, btw.) from a call to SHGetFileInfo from shell32.dll.
i dont want icon inforamtion tht i have already done. wat i want is if a "test.doc" file is selected i want the type as Microsoft Word Document the details for this one is in shlwapi.dll but the same is working for me in vb.net but i want it in c# .. its not working sathy
The information you want is simply the
szTypeName
member of theSHFILEINFO
struct. When you read the documentation forSHGetFileInfo
you'll see that you'll have to specify theSHGFI_TYPENAME
flag to query this piece of information. It's all in the documentation, you just have to read...:) Regards, mav -- Black holes are the places where god divided by 0... -
The information you want is simply the
szTypeName
member of theSHFILEINFO
struct. When you read the documentation forSHGetFileInfo
you'll see that you'll have to specify theSHGFI_TYPENAME
flag to query this piece of information. It's all in the documentation, you just have to read...:) Regards, mav -- Black holes are the places where god divided by 0...