Visit our Sponsor   Visit our Sponsor
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







Startblatt.de






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 (3)


Adding Explorer ToolBar BtnFormat this article printer-friendly!Bookmark function is only available for registered users!
Band Object
Product:
Delphi 5.x (or higher)
Category:
COM+
Skill Level:
Scoring:
Last Update:
12/28/2001
Search Keys:
delphi delphi3000 article borland vcl code-snippet Explorer ToolBar butoon band object
Times Scored:
3
Visits:
4810
Uploader: Khalid A.
Company: SEC
Reference: N/A
 
Question/Problem/Abstract:
creating  Explorer ToolBar Button
Answer:



type
  TConnType =(COM_OBJECT,EXPLORER_BAR,SCRIPT,EXECUTABLE);


function AddBandToolbarBtn(Visible: Boolean; ConnType: TConnType;
         BtnText, HotIcon,Icon, GuidOrPath:string):string;
var
  GUID: TGUID;
  Reg: TRegistry;
  ID: string;
begin
  CreateGuid(GUID);
  ID := GuidToString(GUID);
  Reg := TRegistry.Create;
  with Reg do try
    RootKey := HKEY_LOCAL_MACHINE;
    OpenKey('\Software\Microsoft\Internet Explorer\Extensions\'
            + ID, True);
    if Visible then
         WriteString('Default Visible','Yes')
       else
         WriteString('Default Visible','No');
         WriteString('ButtonText',BtnText);
         WriteString('HotIcon',HotIcon);
         WriteString('Icon',Icon);
    Case ConnType of
      COM_OBJECT:
      begin
        WriteString('CLSID','{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}');
        WriteString('ClsidExtension',GuidOrPath);
        end;
      EXPLORER_BAR:
       begin
        WriteString('CLSID','{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}');
        WriteString('BandCLSID',GuidOrPath);
        end;
      EXECUTABLE:
        begin
        WriteString('CLSID','{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}');
        WriteString('Exec',GuidOrPath);
        end;
      SCRIPT:
        begin
        writeString('CLSID','{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}');
        WriteString('Script',GuidOrPath);
        end;
      end;
    CloseKey;
    OpenKey('\Software\IE5Tools\ToolBar Buttons\',True);
    WriteString(BtnText,ID);
    CloseKey;
  finally
    Free;
  end;
  Result :=ID;
end;







Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Example
    Jun Pattugalan (Mar 30 2002 7:02AM)

Could you give an example?
Respond

Small example
    Osama Katanai (Feb 6 2002 4:55PM)

dear khalid,

  could u plz give me a small example on how it works ?
Respond

some explanations
    PEPS ^^ (Dec 28 2001 3:36PM)

hi Khalid,

thanks for your upload !! one thing: please enter a little bit of text.. some explanations are always very helpful !

thanks
bernhard

DELPHI3000 - Editorial

Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
A. B. Talal
 
   














 







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