Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Adding Explorer Bar Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
02-Jun-03
Category
COM+
Language
Delphi 5.x
Views
126
User Rating
10
# Votes
1
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Khalid A

Creating Custom Explorer Bars , Band Object

Answer:

1   function AddExplorerBar(BarTitle, Url: string; BarSize: Int64; Horizontal:
2     Boolean): string;
3   const
4     EXPLORERBAR_ID = '{4D5C8C2A-D075-11d0-B416-00C04FB90376}';
5     VERTICAL_BAR = '{00021493-0000-0000-C000-000000000046}';
6     HORIZONTAL_BAR = '{00021494-0000-0000-C000-000000000046}';
7   var
8     GUID: TGUID;
9     SysDir, ID: string;
10    Reg: TRegistry;
11  begin
12    CreateGuid(GUID);
13    ID := GuidToString(GUID);
14    Reg := TRegistry.Create;
15    with Reg do
16    try
17      RootKey := HKEY_CLASSES_ROOT;
18      OpenKey('\CLSID\' + ID, True);
19      WriteString('', 'BarTitle');
20      CloseKey;
21      CreateKey('\CLSID\' + ID + '\Implemented Categories');
22      if HORIZONTAL then
23        CreateKey('\CLSID\' + ID + '\Implemented Categories\' +
24          HORIZONTAL_BAR)
25      else
26        CreateKey('\CLSID\' + ID + '\Implemented Categories\' +
27          VERTICAL_BAR);
28      SetLength(SysDir, 255);
29      GetSysDirectory(PChar(SysDir), 255);
30      SysDir := PChar(SysDir) + '\SHDOCVW.DLL';
31      OpenKey('\CLSID\' + ID + '\InProcServer32', True);
32      Writestring('', SysDir);
33      WriteString('Threadingmodel', 'Apartment');
34      CloseKey;
35      OpenKey('\CLSID\' + ID + '\Instance', True);
36      WriteString('CLSID', EXPLORERBAR_ID);
37      CloseKey;
38      OpenKey('\CLSID\' + ID + '\Instance\InitPropertyBag', True);
39      WriteString('Url', URL);
40      CloseKey;
41      RootKey := HKEY_LOCAL_MACHINE;
42      OpenKey('Software\Microsoft\Internet Explorer\Explorer Bars\'
43        + ID, True);
44      WriteBinaryData('BarSize', BarSize, SizeOf(BarSize));
45      CloseKey;
46      OpenKey('\Software\IE5Tools\Explorer Bars\', True);
47      WriteString(BarTitle, ID);
48      CloseKey;
49      OpenKey('\Software\Microsoft\Internet Explorer\Toolbar', True)
50        WriteString(ID, '');
51      CloseKey;
52    finally
53      Free;
54    end;
55    result := ID;
56  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC