How to set thumbnail image to a file icon of Explorer
-
Some image viewer application programs, for example, Adobe Photoshop(http://www.adobe.com/) or SolidWorks(http://www.solidworks.com) set thumbnail image of a file to its file icon in Explorer so that the users can know the content of the image file without opening it. (I do not imply "Thumbnail View" when Explorer is at "Web Page" mode, but customized icon only for a file in place of the application's general file icon.) I want to do same thing above in my application program. If anybody know how to set thumbnail image (custamized icon) to a file icon in place of the application's general file icon in Explorer, please tell me. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
-
Some image viewer application programs, for example, Adobe Photoshop(http://www.adobe.com/) or SolidWorks(http://www.solidworks.com) set thumbnail image of a file to its file icon in Explorer so that the users can know the content of the image file without opening it. (I do not imply "Thumbnail View" when Explorer is at "Web Page" mode, but customized icon only for a file in place of the application's general file icon.) I want to do same thing above in my application program. If anybody know how to set thumbnail image (custamized icon) to a file icon in place of the application's general file icon in Explorer, please tell me. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
-
Some image viewer application programs, for example, Adobe Photoshop(http://www.adobe.com/) or SolidWorks(http://www.solidworks.com) set thumbnail image of a file to its file icon in Explorer so that the users can know the content of the image file without opening it. (I do not imply "Thumbnail View" when Explorer is at "Web Page" mode, but customized icon only for a file in place of the application's general file icon.) I want to do same thing above in my application program. If anybody know how to set thumbnail image (custamized icon) to a file icon in place of the application's general file icon in Explorer, please tell me. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
Check out my shell extension article on this subject. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
-
Check out my shell extension article on this subject. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
Thank you for your reply. I think that's what I want to know. I'm going to see the recommended article in detail. :) ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
-
Check out my shell extension article on this subject. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
At first, I greatly appreciate your advice. I can understand how to customize the icons and icon handler architecture. Well, I have another question: - - - How to retrieve a handle to an icon from the specified file as we can do same thing from DLL or EXE using 'ExtractIcon' function ? - - - I'm sorry to trouble you so often. If you can find time for me, please tell me the solution about this. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
-
At first, I greatly appreciate your advice. I can understand how to customize the icons and icon handler architecture. Well, I have another question: - - - How to retrieve a handle to an icon from the specified file as we can do same thing from DLL or EXE using 'ExtractIcon' function ? - - - I'm sorry to trouble you so often. If you can find time for me, please tell me the solution about this. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
How to retrieve a handle to an icon from the specified file as we can do same thing from DLL or EXE using 'ExtractIcon' function? Sorry, I don't quite understand what you're asking. Is ExtractIcon not working? --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
-
How to retrieve a handle to an icon from the specified file as we can do same thing from DLL or EXE using 'ExtractIcon' function? Sorry, I don't quite understand what you're asking. Is ExtractIcon not working? --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
Oh, I apologize to you if my description was not enough. At first, Visual C++ 6.0 Help reads that ExtractIcon function retrieves a handle to an icon from the specified executable file, dynamic-link library (DLL), or icon file. Then, I actually try to use ExtractIcon function for text file (.txt), but ExtractIcon would not work as Help reads. If there is a way to retrieve a handle to an icon from '.EXE', '.DLL', or '.ICO', I think there is also a way to do same from '.TXT'. Should I use IExtractIcon interface like Explorer? If so, I want to know how to use IExtractIcon interface ( I understand how to implement IExtractIcon interface for Explorer to use thanks to you ). Or, If there is more easier way like using ExtractIcon for '.EXE', '.DLL', or '.ICO, please instruct me. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
-
Oh, I apologize to you if my description was not enough. At first, Visual C++ 6.0 Help reads that ExtractIcon function retrieves a handle to an icon from the specified executable file, dynamic-link library (DLL), or icon file. Then, I actually try to use ExtractIcon function for text file (.txt), but ExtractIcon would not work as Help reads. If there is a way to retrieve a handle to an icon from '.EXE', '.DLL', or '.ICO', I think there is also a way to do same from '.TXT'. Should I use IExtractIcon interface like Explorer? If so, I want to know how to use IExtractIcon interface ( I understand how to implement IExtractIcon interface for Explorer to use thanks to you ). Or, If there is more easier way like using ExtractIcon for '.EXE', '.DLL', or '.ICO, please instruct me. ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------
Ah ok, you want to get the icon that's used for TXT files, right? The way to do that is with SHGetFileInfo(), such as:
SHFILEINFO info;
SHGetFileInfo ( _T("foo.txt"), FILE_ATTRIBUTE_NORMAL, &info, sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_USEFILEATTRIBUTES );After that, info.hIcon is the icon. Add SHGFI_SMALLICON to the flags if you want the small (16x16) icon. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
-
Ah ok, you want to get the icon that's used for TXT files, right? The way to do that is with SHGetFileInfo(), such as:
SHFILEINFO info;
SHGetFileInfo ( _T("foo.txt"), FILE_ATTRIBUTE_NORMAL, &info, sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_USEFILEATTRIBUTES );After that, info.hIcon is the icon. Add SHGFI_SMALLICON to the flags if you want the small (16x16) icon. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.
Yes, that's what I want to do. Thank you very much. Also, I'm coming to understand where I should refer in VC++ Help thanks to your advices, so I wish to express my appreciation to you again. Thanks a lot. Sincerely yours ------------------------------- Masahiro Kurosawa kurosaw@itg.hitachi.co.jp -------------------------------