delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


Extract Icons From Shell32.dll LibraryGo to colin pringle's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Extract Icons From Files Its Easy
Product:
Delphi all versions
Category:
N/A
Skill Level:
Scoring:
Last Update:
12/18/2001
Search Keys:
delphi delphi3000 article borland vcl code-snippet shell32.dll Extract Icons gui look ie explorer windows shell
Times Scored:
3
Visits:
7933
Uploader: colin pringle
Company: cjpsoftware
Reference: cjpsoftware.com
 
Question/Problem/Abstract:
Extract icons from files using shell32.dll
Answer:





ShellSPY V1.1a

is the award winning and powerful monitoring solution that you need! ShellSPY
gives you the power to log all keystrokes, windows viewed, applications ran, internet
connections made, passwords entered, chat conversations that were made, Monitor
all running tasks on your pc Download
Now


// Do not distribute this code
// Author C Pringle Cjpsoftware.com
// Please request authorization from cjpsoftware
// Copy and paste this code into a new unit.
// drop a imagelist into the form. And a statusbar / edit / button
// Example.
// Type the file you want to extract the icon I.E XXXX.EXE
// then click on the button. And the icon will appear in the statusbar
// below..
// If you like anymore hints and tips about icons drop me an email..
//

unit extracticonfromfile;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,shellapi,comobj, ComCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Myimages: TImageList;
    Edit1: TEdit;
    StatusBar1: TStatusBar;
    procedure Button1Click(Sender: TObject);
    procedure StatusBar1DrawPanel(StatusBar: TStatusBar;
      Panel: TStatusPanel; const Rect: TRect);
  private
    { Private declarations }
  public
    { Public declarations }
  Procedure ExtractIcon(EXEName: String);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

Procedure Tform1.ExtractIcon(EXEName: String);
function GetIndexOfExtSmall( ext: String ): Hicon;
var shfi: TSHFileInfo;
begin
  ShGetFileInfo(Pchar(Ext), 0, SHFi,
  SizeOf(SHFi), SHGFI_EXETYPE or SHGFI_ICON or SHGFI_SYSICONINDEX or SHGFI_SMALLICON );
    result := shfi.HIcon;
end;
Var Icon2: Ticon;
    Index: Integer;
Begin
Icon2 := TIcon.Create;
If GetIndexofExtSmall(Exename) > 0 Then
   Begin
   Icon2.Handle := GetIndexOfExtSmall(Exename);
   Index := myimages.AddIcon(Icon2);
   End;
Icon2.Free;
End;


procedure TForm1.Button1Click(Sender: TObject);
begin
Extracticon(edit1.text);
statusbar1.refresh;
end;

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
with StatusBar1.Canvas do
  begin

    Brush.Color := clSilver;
    FillRect(Rect);
    Font.Color := clblack;
    Myimages.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top,0);
    //TextOut(Rect.left + 20, Rect.top + 2,Message1[0]);
End;
end;

end.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
creating & extracting icons
    jeff smith (Mar 12 2005 12:12AM)

Hello their sir,new at the pc biz so please bare with me.(1.)  I would like to know,step by step how to take an image and create an icon from it.(2.) I know ,or at least i think the icons are in system32\shell32.dll. I would like to know how to view the icons,so i can edit some of them.
(3.) Plus,one more thing,do you know how to add an image to the background of afolder,instead of the folders background being white,the whole screen will have an image.
                Thank you very much sir.Youre help will realy be appreciated.
                              youre friend.jeff smith
      jhrsmith@bellsouth.net

           please let me know something,please.
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
Hans Gulö
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)