Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How do I access the windows system icons? Posted by jobromedia on 3 Dec 2005 at 5:55 PM
How do I do this? I've googled all over the world but found none.
Report
Re: How do I access the windows system icons? Posted by jamesb800 on 3 Dec 2005 at 6:19 PM
Look for ResHacker....then open the shell32.dll

: How do I do this? I've googled all over the world but found none.
:

Report
Re: How do I access the windows system icons? Posted by Gaashius on 4 Dec 2005 at 9:42 AM
: Look for ResHacker....then open the shell32.dll
:
: : How do I do this? I've googled all over the world but found none.
: :
:
:
http://www.programmersheaven.com/search/Download.asp?FileID=16956
****************

GAASHIUS


Report
Re: How do I access the windows system icons? Posted by jobromedia on 5 Dec 2005 at 2:25 PM
: : Look for ResHacker....then open the shell32.dll
: :
: : : How do I do this? I've googled all over the world but found none.
: : :
: :
: :
: http://www.programmersheaven.com/search/Download.asp?FileID=16956
: ****************
:
: GAASHIUS

Nice one. But is there a way to call the Shell32.dll to load say an icon into a picture resource in my app?
:
:
:

Report
Re: How do I access the windows system icons? Posted by zibadian on 5 Dec 2005 at 2:35 PM
: : : Look for ResHacker....then open the shell32.dll
: : :
: : : : How do I do this? I've googled all over the world but found none.
: : : :
: : :
: : :
: : http://www.programmersheaven.com/search/Download.asp?FileID=16956
: : ****************
: :
: : GAASHIUS
:
: Nice one. But is there a way to call the Shell32.dll to load say an icon into a picture resource in my app?
: :
: :
: :
:
:
You could try the TBitmap.LoadFromResourceID() or TBitmap.LoadFromResourceName() methods. Or try to get the icon handle using LoadIcon() API function, which you cn then assign to the TIcon.Handle property.
Report
Re: How do I access the windows system icons? Posted by jobromedia on 6 Dec 2005 at 9:53 PM
This message was edited by jobromedia at 2005-12-6 21:59:25

: You could try the TBitmap.LoadFromResourceID() or TBitmap.LoadFromResourceName() methods. Or try to get the icon handle using LoadIcon() API function, which you cn then assign to the TIcon.Handle property.
:
I'm totally out in the blue here.

bmp.LoadFromResourceID(what,what)

Sorry for being so noob here, but if I can't get a explanation in plain english then I just have to hack the resources out, and guessing the ID isn't an easy task either.


Report
Re: How do I access the windows system icons? Posted by zibadian on 7 Dec 2005 at 3:01 AM
: This message was edited by jobromedia at 2005-12-6 21:59:25

: : You could try the TBitmap.LoadFromResourceID() or TBitmap.LoadFromResourceName() methods. Or try to get the icon handle using LoadIcon() API function, which you cn then assign to the TIcon.Handle property.
: :
: I'm totally out in the blue here.
:
: bmp.LoadFromResourceID(what,what)
:
: Sorry for being so noob here, but if I can't get a explanation in plain english then I just have to hack the resources out, and guessing the ID isn't an easy task either.
:
:
:
I've found that you can cannot use this function to load the icon into a bitmap. You can however use the similar LoadIcon() API function to get the handle of the icons.
The hInstance handle is returned by the LoadLibrary() API function. If you use the ID's for the icons instead of their names, then it is quite simple to figure out which icon is which.
In the windows explorer: if you change the icon of a program/link file you get a complete gallery of all the icons within that file. These are numbered starting with 1 in the top left corner. For the shell32.dll file these are:
1   Unknown file type
2   Text Document
3   Console program
4   Closed Folder
5   Opened Folder
6   5.25" Floppy
7   3.5" Floppy
etc.

Now for a simple example: this code loads the icon for a networked drive into an image component:
procedure TForm1.Button1Click(Sender: TObject);
var
  H: THandle;
begin
  H := LoadLibrary('shell32.dll');
  Image1.Picture.Icon.Handle := LoadIcon(H, '#10');
  FreeLibrary(H);
end;

The #10 string indicates which icon to load.
Report
Re: How do I access the windows system icons? Posted by jobromedia on 9 Dec 2005 at 2:58 PM
: : This message was edited by jobromedia at 2005-12-6 21:59:25

: : : You could try the TBitmap.LoadFromResourceID() or TBitmap.LoadFromResourceName() methods. Or try to get the icon handle using LoadIcon() API function, which you cn then assign to the TIcon.Handle property.
: : :
: : I'm totally out in the blue here.
: :
: : bmp.LoadFromResourceID(what,what)
: :
: : Sorry for being so noob here, but if I can't get a explanation in plain english then I just have to hack the resources out, and guessing the ID isn't an easy task either.
: :
: :
: :
: I've found that you can cannot use this function to load the icon into a bitmap. You can however use the similar LoadIcon() API function to get the handle of the icons.
: The hInstance handle is returned by the LoadLibrary() API function. If you use the ID's for the icons instead of their names, then it is quite simple to figure out which icon is which.
: In the windows explorer: if you change the icon of a program/link file you get a complete gallery of all the icons within that file. These are numbered starting with 1 in the top left corner. For the shell32.dll file these are:
:
: 1   Unknown file type
: 2   Text Document
: 3   Console program
: 4   Closed Folder
: 5   Opened Folder
: 6   5.25" Floppy
: 7   3.5" Floppy
: etc.
: 

: Now for a simple example: this code loads the icon for a networked drive into an image component:
:
: procedure TForm1.Button1Click(Sender: TObject);
: var
:   H: THandle;
: begin
:   H := LoadLibrary('shell32.dll');
:   Image1.Picture.Icon.Handle := LoadIcon(H, '#10');
:   FreeLibrary(H);
: end;
: 

: The #10 string indicates which icon to load.
:
Ah that simple, thanks a million for helping me out, I was beginning to pull my hair off...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.