// ´Ù±¹¾î ÇÁ·Î±×·¥ ¸¸µé¶§ »ç¿ëÇØ º¸¼¼¿ä
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TCharSetRec = packed record
Name: String;
ID: Integer end;
const
NumCharSets = 19;
CharSets: array[0..NumCharSets - 1] of TCharSetRec = (
(Name: 'ANSI_CHARSET'; ID: 0),
(Name: 'DEFAULT_CHARSET'; ID: 1),
(Name: 'SYMBOL_CHARSET'; ID: 2),
(Name: 'SHIFTJIS_CHARSET'; ID: $80),
(Name: 'HANGEUL_CHARSET'; ID: 129),
(Name: 'GB2312_CHARSET'; ID: 134),
(Name: 'CHINESEBIG5_CHARSET'; ID: 136),
(Name: 'OEM_CHARSET'; ID: 255),
(Name: 'JOHAB_CHARSET'; ID: 130),
(Name: 'HEBREW_CHARSET'; ID: 177),
(Name: 'ARABIC_CHARSET'; ID: 178),
(Name: 'GREEK_CHARSET'; ID: 161),
(Name: 'TURKISH_CHARSET'; ID: 162),
(Name: 'VIETNAMESE_CHARSET'; ID: 163),
(Name: 'THAI_CHARSET'; ID: 222),
(Name: 'EASTEUROPE_CHARSET'; ID: 238),
(Name: 'RUSSIAN_CHARSET'; ID: 204),
(Name: 'MAC_CHARSET'; ID: 77),
(Name: 'BALTIC_CHARSET'; ID: 186));
var
Form1: TForm1;
implementation
{$R *.dfm}
// Windows Default GUI ÆùÆ®¸¦ ±¸ÇÑ´Ù
function GetDefaultUIFont(var lf: TLogFont): Boolean;
var
font: HFONT;
begin
Result := False;
font := GetStockObject(DEFAULT_GUI_FONT);
if font = NULL then
Exit;
if GetObject(font, sizeof(lf), @lf) = 0 then
Exit;
Result := True;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
lf: TLogFont;
begin
if not GetDefaultUIFont(lf) then
Exit;
ShowMessage(lf.lfFaceName); // ÆùÆ®¸í
for i := 0 to NumCharSets - 1 do
if CharSets[i].ID = lf.lfCharSet then
begin
ShowMessage(CharSets[i].Name); // ¹®ÀÚ¼Â
Break
end;
end;
end. |
|