Solved

Assigne FontName For Internet Option With Code in Delphi

Posted on 2001-07-27
4
175 Views
Last Modified: 2010-04-06
i want assigne a Font to USER DEFINE in internet option.
in internet explorer 5 :
i open internet option in control panel , then
click on FONT button.
then open LANGUEGE SCRIPT combo box and select
USER DEFINE.
then select from WEB PAGE FONT list box my font name.
please tell me who i can implementation this act with code in delphi.
i want complete answer
please help me
thank
0
Comment
Question by:mpzlarge40
  • 3
4 Comments
 
LVL 21

Accepted Solution

by:
gemarti earned 100 total points
Comment Utility
Well I guess I'll give this a shot....

There are two key values in the following registry keys that are changed when you change the information on this page you describe:

(windows 2k )
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\International\Scripts

(Windows 9x)
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\International


Here is code that is very rough and dirty. When the form first opens it populates the three list boxes. Listbox1 holds the subkeys to the registry setting for IE5.0. ListBox2 holds the values for the currently selected subkey from listbox1 (Form1.OnCreate gives you the value for HKCU\Software\Microsoft\Internet Explorer\International\Scripts) this value is the default_script.

If you click one of the items in ListBox1 the registry will open that subkey and get the Values IEFixedFontName IEPropFontName and Script(Windows 9x). These values will show up in ListBox2. The corresponding fonts for each of these values will show up in listbox3.

To modify one of these fonts (this is the rough and dirty work) you click on listbox2; an inputbox will appear indicating that it needs a new font name. This is where you add your font. When you click okay it over writes the data for that key value.  

The problem here is this: the USER DEFINED key seems to change (i.e. the first time I tried this i found that HKLM\Software\Microsoft\Internet Explorer\International\Scripts\03) was the location for the USER DEFINED key, but when I changed it again it was 40???


anyway here is the code:

Hope this helps.


--------cut below this line---------------

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    ListBox2: TListBox;
    ListBox3: TListBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    procedure ListBox1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ListBox2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;

var
  Form1: TForm1;
  Keyname2 : String;
  Defaultscrpt : Integer;
implementation

{$R *.DFM}

procedure TForm1.ListBox1Click(Sender: TObject);
var
  Reg: TRegistry;
  Buffer : Integer;
  i : Integer;
  ValueName,KeyName : String;
  Value : TRegKeyInfo;
  Strings : TStrings;
begin
  Reg := TRegistry.Create;
  Strings := TStringList.Create;
  try
    ListBox2.Clear;
    ListBox3.Clear;
    Reg.RootKey := HKEY_CURRENT_USER;
    i:=ListBox1.ItemIndex;
    KeyName := '\Software\Microsoft\Internet Explorer\International\Scripts\';
    KeyName := KeyName+ListBox1.Items.Strings[i];
    Keyname2 := KeyName;
    if Reg.OpenKey(KeyName,False) then
      begin
        Reg.GetKeyInfo(value);
        Reg.GetValueNames(Strings);
        ListBox2.Items.AddStrings(Strings);
        for i := 0 to ListBox2.Items.Count -1 do
          begin
            ListBox3.Items.Add(reg.ReadString(ListBox2.Items.Strings[i]));
          end;
      end;

  finally
    Strings.Free;
    Reg.Free;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  Reg: TRegistry;
  Buffer : Integer;
  Value : TRegKeyInfo;
  Strings : TStrings;
begin
  Reg := TRegistry.Create;
   Strings := TStringList.Create;
   ListBox1.Clear;
   ListBox2.Clear;
   ListBox3.Clear;
  try
    Reg.RootKey := HKEY_CURRENT_USER;
    if Reg.OpenKey('\Software\Microsoft\Internet Explorer\International\Scripts',False) then
      begin

        Reg.GetKeyInfo(value);
        Reg.GetKeyNames(Strings);
        ListBox1.Items.AddStrings(Strings);

        Reg.GetValueNames(Strings);
        ListBox2.Items.AddStrings(Strings);

        Reg.ReadBinaryData(Strings.GetText,Buffer,1000);
        DefaultScrpt := Buffer;
        ListBox3.Items.Add(IntToStr(Buffer));
        Reg.CloseKey;
        end;

  finally
    Strings.Free;
    Reg.Free;

  end;
end;
procedure TForm1.ListBox2Click(Sender: TObject);
var
  Reg: TRegistry;
  Buffer : Integer;
  i : Integer;
  ValueName,KeyName : String;
  Value : TRegKeyInfo;
  Strings : TStrings;
  GetStr : String;
begin
  Reg := TRegistry.Create;
  Strings := TStringList.Create;
  try
    ListBox3.Clear;
    Reg.RootKey := HKEY_CURRENT_USER;
    Keyname := KeyName2;
    if Reg.OpenKey(KeyName,False) then
      begin
        i := ListBox2.ItemIndex;
        GetStr := InputBox('Key Value'+ ListBox2.Items.Strings[i],'Enter: ',' ');
        Reg.WriteString(ListBox2.Items.Strings[i],GetStr);
      end;
  finally
    Strings.Free;
    Reg.Free;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.OnCreate(Sender);
end;

end.


---------cut above this line -------------

Good Luck

GEM
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
10 questions asked, FEW CLOSED.  PLEASE BRING THEM TO A CONCLUSION AND AWARD EXPERTS WHO HELP YOU.

It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.
 
PLEASE DO NOT AWARD THE POINTS TO ME.
 
____________________________________________
 
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back in about one week to finalize this question.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
 
P.S.  Engineering has been advised about the error in the comment date/time sort order for questions dated last year.  REGARDING POINTS and more:  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp  
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20159412.html
http://www.experts-exchange.com/questions/Q.20159413.html
http://www.experts-exchange.com/questions/Q.20182186.html
http://www.experts-exchange.com/questions/Q.20249612.html
http://www.experts-exchange.com/questions/Q.20264398.html
http://www.experts-exchange.com/questions/Q.20275884.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20264411.html

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations if this item remains inactive another seven (7) days.  If you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed here -> http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
Zero response, finalized.
Moondancer - EE Moderator
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now