How to get MyComputer Icon?
How can i get system icons like: MyComputer, MyDocuments, Desktop, ...
I know how to do it for folders and file extensions but not for icons like mycomputer
Thanks
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
sn4k3
How can i get system icons like: MyComputer, MyDocuments, Desktop, ...
I know how to do it for folders and file extensions but not for icons like mycomputer
Thanks
Icons on desktop are defined in shell32.dll
And they are numbered increasingly,
So you can view them first then
Pick the right one of your flavor.
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
Khiem
Icons on desktop are defined in shell32.dll
And they are numbered increasingly,
So you can view them first then
Pick the right one of your flavor.
any sample over there?
i just need get the 'Icon' from icon
Re: How to get MyComputer Icon?
i remember if i am not mistaken that it may be ExtractIconFromFile of Image class...uh oh you need to check it out again or search google for a complete source code as you wish to obtain. :blink:
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
Khiem
i remember if i am not mistaken that it may be ExtractIconFromFile of Image class...uh oh you need to check it out again or search google for a complete source code as you wish to obtain. :blink:
think not, since MyComputer not have a path, also i want to get MyDocuments Folder icon, mycomputer and desktop icon (with current custom theme icons)
Re: How to get MyComputer Icon?
ExtractIconFromFile will only work with exe files ( at least to my knowledge )
You are right with needing API though.
You need the following to achieve what you want :
API
SHGetFileInfo
Structure
SHFILEINFO
Constants
SHGFI_ICON
SHGFI_SMALLICON
SHGFI_LARGEICON
I did something similar in VB.NET ( unfortunately ), here's the link :
http://www.codeguru.com/forum/showthread.php?t=417770
It should give you an idea of what is needed.
I hope my advice was helpful. :)
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
HanneSThEGreaT
ExtractIconFromFile will only work with exe files ( at least to my knowledge )
You are right with needing API though.
You need the following to achieve what you want :
API
SHGetFileInfo
Structure
SHFILEINFO
Constants
SHGFI_ICON
SHGFI_SMALLICON
SHGFI_LARGEICON
I did something similar in VB.NET ( unfortunately ), here's the link :
http://www.codeguru.com/forum/showthread.php?t=417770
It should give you an idea of what is needed.
I hope my advice was helpful. :)
i already have that and working, but this only works for File and folders
i want to get MyComputer icon wich not have an path and i need Desktop etc...
icons from: SpecialFolders
Re: How to get MyComputer Icon?
Ah, it seems like I need glasses. :blush:
You want the My Computer Icon, My Documents etc.
I've got bad news for you, but, perhaps with a little good news - time will tell :)
The whole problem is, that the My Computer object is merely an object, not really a fixed thing like a file ( if you get what I'm saying ). The only way that you would get this icon ( alongwith Network Places etc. ) will be to digg very deep into the Registry. Inside the Registry you'd need to find each object's CLSID, then use ExtractIcon, DrawIcon etc. APIs to extract it, and draw it onto something.
If you don't know what CLSID is, here's an article about it - as you can relate in the article, I did extensive research on these objects :
http://www.codeguru.com/vb/gen/vb_sy...php/c13987__1/
That is the only solution.
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
HanneSThEGreaT
Ah, it seems like I need glasses. :blush:
You want the My Computer Icon, My Documents etc.
I've got bad news for you, but, perhaps with a little good news - time will tell :)
The whole problem is, that the My Computer object is merely an object, not really a fixed thing like a file ( if you get what I'm saying ). The only way that you would get this icon ( alongwith Network Places etc. ) will be to digg very deep into the Registry. Inside the Registry you'd need to find each object's CLSID, then use ExtractIcon, DrawIcon etc. APIs to extract it, and draw it onto something.
If you don't know what CLSID is, here's an article about it - as you can relate in the article, I did extensive research on these objects :
http://www.codeguru.com/vb/gen/vb_sy...php/c13987__1/
That is the only solution.
yes it works, but it return Original icon, currently i have vista icons on my XP Theme and it return original XP theme icons now can i get the current theme icons?
Re: How to get MyComputer Icon?
Good, we're making progress :)
You first have to determine if a theme is active, then perhaps further investigate the source of the icon :)
To determine if a theme is Active, you need to use the IsAppThemed API inside UxTheme.dll.
My article ( here ) goes into more details about using UxTheme.dll, I hope it helps!
Re: How to get MyComputer Icon?
Quote:
Originally Posted by
HanneSThEGreaT
Good, we're making progress :)
You first have to determine if a theme is active, then perhaps further investigate the source of the icon :)
To determine if a theme is Active, you need to use the
IsAppThemed API inside
UxTheme.dll.
My article (
here ) goes into more details about using UxTheme.dll, I hope it helps!
yes and how can i extract the icon from theme?
how others programs do? like filezilla or winrar ...
probaly should exist a easy way to do that
Re: How to get MyComputer Icon?