::: µ¨ÆÄÀÌ Tip&Trick :::

µ¨ÆÄÀÌ Tip&Trick ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2003-03-07 09:14:09, Hit : 4627, Vote : 1201
 ·¹Áö½ºÆ®¸® Àüü °Ë»öÇϱâ

// RadioGroup ÀÇ Items ¿¡ ¾Æ·¡ 5°³ÀÇ °ªÀ¸·Î
//    HKEY_CURRENT_USER
//    HKEY_LOCAL_MACHINE
//    HKEY_CLASSES_ROOT
//    HKEY_CURRENT_CONFIG
//    HKEY_USERS
// Ç׸ñÀ» Ãß°¡Çϼ¼¿ä

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    Label1: TLabel;
    RadioGroup1: TRadioGroup;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure RadioGroup1Click(Sender: TObject);
  private
    { Private declarations }
    FRootKey: HKEY;
    procedure GetSubKeys(ARegistry: TRegistry; AKey: string;
                         ALevel: integer; AStrings: TStrings);
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}

const
  CBaseKey = '';

procedure TForm1.GetSubKeys(ARegistry: TRegistry; AKey: string;
                            ALevel: integer; AStrings: TStrings);
var
  fill:    string;
  i:       integer;
  j:       integer;
  thisKey: string;
  tmpKeys: TStringList;
begin
  if ARegistry.OpenKey(AKey, false) then
  begin
    Label1.Caption := AKey;
    Application.ProcessMessages;
    try
      ARegistry.GetKeyNames(AStrings);

      if AStrings.Count > 0 then
      begin
        for i := AStrings.Count - 1 downto 0 do
        begin
          tmpKeys := TStringList.Create;
          try
            thisKey := AKey + '' + AStrings[i];
            Label1.Caption := thisKey;
            Application.ProcessMessages;
            GetSubKeys(ARegistry, thisKey, ALevel, tmpKeys);
            Inc(ALevel);
            try
              SetLength(fill, ALevel * 2);
              FillChar(fill[1], Length(fill), ' ');

              for j := tmpKeys.Count - 1 downto 0 do
                AStrings.Insert(i + 1, fill + tmpKeys[j]);
            finally
              Dec(ALevel);
            end;
          finally
            tmpKeys.Free;
          end;
        end;
      end;
    finally
      ARegistry.CloseKey;
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
const
  level: integer = 0;
var
  fill:        string;
  i:           integer;
  j:           integer;
  theKeys:     TStringList;
  theRegistry: TRegistry;
  tmpKeys:     TStringList;
begin
  ListBox1.Clear;

  theRegistry := TRegistry.Create;
  try
    with theRegistry do
    begin
      RootKey := FRootKey;
      OpenKey(CBaseKey, False);
      theKeys := TStringList.Create;
      try
        GetKeyNames(theKeys);

        if theKeys.Count > 0 then
        begin
          for i := theKeys.Count - 1 downto 0 do
          begin
            tmpKeys := TStringList.Create;
            try
              GetSubKeys(theRegistry, CBaseKey + theKeys[i], level, tmpKeys);
              Inc(level);
              try
                SetLength(fill, level * 2);
                FillChar(fill[1], Length(fill), ' ');

                for j := tmpKeys.Count - 1 downto 0 do
                  theKeys.Insert(i + 1, fill + tmpKeys[j]);
              finally
                Dec(level);
              end;
            finally
              tmpKeys.Free;
            end;
          end;
        end;

        ListBox1.Items.Assign(theKeys);
        ListBox1.Items.SaveToFile('C:Temp'
                                  + RadioGroup1.Items[RadioGroup1.ItemIndex]
                                  + '.Txt');
        Label1.Caption := IntToStr(ListBox1.Items.Count);
      finally
        theKeys.Free;
      end;
    end;
  finally
    theRegistry.Free;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  RadioGroup1.ItemIndex := 0;
end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
  case RadioGroup1.ItemIndex of
    0: FRootKey := HKEY_CURRENT_USER;
    1: FRootKey := HKEY_LOCAL_MACHINE;
    2: FRootKey := HKEY_CLASSES_ROOT;
    3: FRootKey := HKEY_CURRENT_CONFIG;
    4: FRootKey := HKEY_USERS;
  end;
end;

end.





571   [À©µµ¿ìÁî API] À©µµ¿ìÁî '½ÃÀÛ' ¸Þ´º Refresh ½ÃÅ°±â  ±è¿µ´ë 2003/03/07 5065 1483
570   [À©µµ¿ìÁî API] ´Ù¸¥ ApplicationÀÇ È­¸é¿¡ ±ÛÀÚ,±×¸²À» Ãâ·ÂÇÏ±â  ±è¿µ´ë 2003/03/07 3719 934
569   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] WideString À» String À¸·Î ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 4933 1257
568   [À©µµ¿ìÁî API] À©µµ¿ìÁî Ž»ö±âÀÇ ÆÄÀÏ, ÄÄÇ»ÅÍ Ã£±â È­¸é ¶ç¿ì±â  ±è¿µ´ë 2003/03/07 6618 1710
567   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] MessageDlg()ÀÇ ÆùÆ®¸¦ ¹Ù²Ù¾î¼­ ¶ç¿ì±â  ±è¿µ´ë 2003/03/07 4222 1105
566   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListView ÀÇ item À» °­Á¦·Î ÆíÁý»óÅ·Π¸¸µé±â  ±è¿µ´ë 2003/03/07 4967 1272
565   [µ¥ÀÌÅͺ£À̽º] µ¿ÀûÀ¸·Î SELECTÀÇ GROUP BY ¹® ¸¸µé±â  ±è¿µ´ë 2003/03/07 4515 995
564   [À©µµ¿ìÁî API] ALT_F4 hot key °¡·Îä±â  ±è¿µ´ë 2003/03/07 6018 1711
  [À©µµ¿ìÁî API] ·¹Áö½ºÆ®¸® Àüü °Ë»öÇÏ±â  ±è¿µ´ë 2003/03/07 4627 1201
562   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TOpenDialog ÀÇ '¼±ÅÃ','Ãë¼Ò' ¹öÆ° À̸§ ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 4643 1392
561   [À©µµ¿ìÁî API] ¸ð¼­¸®°¡ µÕ±Ù(rounded ends) TEdit ¸¸µé±â  ±è¿µ´ë 2003/03/07 5467 1357
560   [½Ã½ºÅÛ] ÇÁ·Î±×·¥ÀÌ µ¿ÀûÀ¸·Î ÇÒ´ç¹ÞÀº ¸Þ¸ð¸® Å©±â ?  ±è¿µ´ë 2003/03/07 4865 1366
559   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] OnActivate À̺¥Æ® ³»¿¡¼­ Æû È®½ÇÈ÷ ´Ý±â  ±è¿µ´ë 2003/03/07 4514 1137
558   [µ¥ÀÌÅͺ£À̽º] QueryÇÑ °á°ú¸¦ ¼öÁ¤Çϱâ...  ±è¿µ´ë 2003/03/07 5207 1252
557   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] StringGridÀÇ CellÀ» °­Á¦·Î ´ÙÁß ¼±ÅÃ/ÇØÁ¦ ½ÃÅ°±â  ±è¿µ´ë 2003/03/07 4398 1059
556   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TRichEditÀÇ Çà°£°Ý ¶ç¿ì±â(line spacing)  ±è¿µ´ë 2003/03/07 5835 1545
555   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÇÁ¸°ÅÍ·Î escape ¹®ÀÚ Ãâ·ÂÇϱâ(raw print)  ±è¿µ´ë 2003/03/07 5437 1342
554   [À©µµ¿ìÁî API] keyboard, mouse ¸Þ½ÃÁö ¹«½Ã(skip) ÇÏ±â  ±è¿µ´ë 2003/03/07 4786 1259
553   [À©µµ¿ìÁî API] À©µµ¿ìÁî Ä¿¼­(global cursor) ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 7577 2316
552   [½Ã½ºÅÛ] ÇöÀç ÇÁ¸°ÅÍÀÇ Ãâ·Â°¡´ÉÇÑ ¿ëÁöÁ¾·ù ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 6640 1748
551   [½Ã½ºÅÛ] ÇÁ¸°ÅÍ¿¡ ÀÛ¾÷ÁßÀÎ jobÀÇ ¸®½ºÆ® ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 5239 1299
550   [½Ã½ºÅÛ] Clipboard ÈÉÃ帱â(Clipboard hooking)  ±è¿µ´ë 2003/03/07 7384 1665
549   [À©µµ¿ìÁî API] ControlÀÇ repainting ±ÝÁöÇÏ¿© ±ô¹ÚÀÓ ÁÙÀÌ±â  ±è¿µ´ë 2003/03/07 6202 1335
548   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¹®ÀÚ¿­ÀÇ ³¡¿¡¼­ºÎÅÍ °Ë»öÇÏ´Â Pos() ÇÔ¼ö  ±è¿µ´ë 2003/03/07 5405 1224
547   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] µð·ºÅ丮¸í ¹Ù²Ù±â/À̵¿ ÇÏ±â  ±è¿µ´ë 2003/03/07 5666 1642
546   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] µð·ºÅ丮 º¯µ¿»çÇ×À» Ž»ö±â¿¡ ¾Ë¸®±â  ±è¿µ´ë 2003/03/07 5754 1659
545   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Æû ÀμâÇϱâ 2  ±è¿µ´ë 2003/03/07 4155 1311
544   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¿¬¼ÓµÈ Å°º¸µåÀÇ Å° ¹ß»ý½ÃÅ°±â  ±è¿µ´ë 2003/03/07 4415 1169
543   [½Ã½ºÅÛ] Keyboard Hook  ±è¿µ´ë 2003/03/07 4480 939
542   [À©µµ¿ìÁî API] ·¹Áö½ºÆ®¸®ÀÇ Æ¯Á¤Å°¸¦ ÆÄÀÏ·Î ÀúÀå/º¹¿øÇÏ±â  ±è¿µ´ë 2003/03/07 7118 1603
541   [½Ã½ºÅÛ] PC¿¡ ¼³Ä¡µÈ DirectX ¹öÀü ÀÐ±â  ±è¿µ´ë 2003/03/07 4221 1273
540   [µ¥ÀÌÅͺ£À̽º] CD ¿¡ ÀÖ´Â DB Á¢±ÙÇÏ±â  ±è¿µ´ë 2003/03/07 4093 1140
539   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Á¦¾îÆÇÀÇ applet ¸®½ºÆ® (17°³)  ±è¿µ´ë 2003/03/07 3644 1031
538   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Åõ¸íÇÑ Bitmaps ÀÎ¼â  ±è¿µ´ë 2003/03/07 7932 1510
537   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] QReport ¸¦ bmp ·Î º¯È¯ÇÏ±â  ±è¿µ´ë 2003/03/07 3500 902
536   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] WMF ¸¦ BMP ·Î º¯È¯ÇÏ±â  ±è¿µ´ë 2003/03/07 4685 1405
535   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] MemoÀÇ ÀÔ·ÂÇà¼ö Á¦ÇÑÇÏ±â  ±è¿µ´ë 2003/03/07 4429 1217
534   [½Ã½ºÅÛ] PCÀÇ Àü¿ø»óÅ ¾Ë¾Æº¸±â  ±è¿µ´ë 2003/03/07 6197 3788
533   [À©µµ¿ìÁî API] ÆÄÀÏ¿¡¼­ ¾ÆÀÌÄÜ »©³»±â(32 * 32)  ±è¿µ´ë 2003/03/07 6721 1676
532   [À©µµ¿ìÁî API] ÆÄÀÏ¿¡¼­ ¾ÆÀÌÄÜ »©³»±â(16 * 16)  ±è¿µ´ë 2003/03/07 5124 1331

[ÀÌÀü 10°³] [1].. 11 [12][13][14][15][16][17][18][19][20]..[25] [´ÙÀ½ 10°³]
 

Copyright 1999-2024 Zeroboard / skin by zero