Q&A

  • 레지스트리 에대하여..
안녕하세요.

레지스트리 편집기에서 찾기에서 주어진문자열로 키나문자열를 찾을수 있듯이 프로그램상에서 키나문자열을 찾을수 있는 방법은 없을까요..

TRegistry의 메소드에는 그러한 함수가 없더라구요.(제가 못찾은건지..)

알려주시면 감사하겠습니다.

1  COMMENTS
  • Profile
    김영대 1999.05.14 21:06
    이호선 wrote:

    > 안녕하세요.

    > 레지스트리 편집기에서 찾기에서 주어진문자열로 키나문자열를 찾을수 있듯이 프로그램상에서 키나문자열을 찾을수 있는 방법은 없을까요..

    > TRegistry의 메소드에는 그러한 함수가 없더라구요.(제가 못찾은건지..)

    > 알려주시면 감사하겠습니다.



    // 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.



    • 건맨
    • 1999.05.15 00:23
    • 0 COMMENTS
    • /
    • 0 LIKES
    • 신인재
      1999.05.15 04:59
      안녕하세요... 한델 자료실에 델코권용길님이 만들어 배포하신 인스톨쉴드익스프레스 로터스캠 동영상...
    • 이호선
    • 1999.05.14 20:48
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 김영대
      1999.05.14 21:06
      이호선 wrote: > 안녕하세요. > 레지스트리 편집기에서 찾기에서 주어진문자열로 키나문자열를 찾을수 있...
    • 왕초보
    • 1999.05.14 20:28
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 1999.05.14 21:25
      왕초보 wrote: > db의 내용을 읽어서 exe 프로그램의 treeview에다가 db의 내용을 treeview형태 > 로 만...
    • 양춘호
    • 1999.05.14 20:26
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 이정욱
      1999.05.15 00:35
      적어도 폼만큼은 다시 만드셔야 합니다. 그리고 2.0에는 없지만 3.0에서 생긴 프로퍼티나 이벤트, 메소드...
    • 손덕빈
    • 1999.05.14 19:59
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 왕초보
      1999.05.14 20:22
      tdatabase의 Params Property에 다음과 같이 적으신후 login Prompt를 false로 setting하시고...connecte...
    • 북해
    • 1999.05.14 19:15
    • 2 COMMENTS
    • /
    • 0 LIKES
    • 무명인
      1999.05.15 05:05
      북해 wrote: > 안녕하세요. SQL문을 사용하려는데 자꾸 에러가 나네요. Edit.Text가 Change될 때마다 아래...
    • 왕초보
      1999.05.14 20:18
      with query1 do Begin sql.add('select * from 테이블'); sql.add('where 성명 like '''+edit1.Text+'%...
    • 북해
    • 1999.05.14 19:00
    • 2 COMMENTS
    • /
    • 0 LIKES
    • 이정욱
      1999.05.14 20:15
      보통 컴포넌트를 설치하는 방법은 두가지 입니다. 첫째, PAS나 .DCU파일을 가지고 하는방법. 둘째, DPK나...
    • 왕초보
      1999.05.14 20:15
      델파이 component 메뉴에서 install component를 선택하시면 컴포넌트 모듈(*.pas, *.dcu)를 선택할 수 있...
    • 김승현
    • 1999.05.14 06:01
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 왕초보
      1999.05.14 18:16
      저도 초보라서.. 정확한 답변이 될런지는 모르겠지만 도움일 될까해서 제가 Dll에서 db쓰는 source를 알...
    • 땡글이
    • 1999.05.14 05:27
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 김영대
      1999.05.14 18:08
      땡글이 wrote: > 제가 몇일전에 TreeView에 대해 질문은 올렸더니 고맙게도 답장을 써주셨더군요. > 근데...
    • 1999.05.14 02:45
      이누리 wrote: > EditBox 내의 오른쪽 정렬이 되지 않는 관계로.. > > 편법으로.. 문자열앞에 공백을 ...
    • 이영호
    • 1999.05.14 02:18
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 1999.05.14 02:49
      이영호 wrote: > 오라클에 접속하려고 데이타베이스컴포넌트의 속성을 아래와 같이 주었는데 > db1.Pa...
    • 이정욱
      1999.05.14 03:12
      ParentComp := GetOwner as TWinControl; 로 고쳐서 해보세요... 장담은 못합니다... ^^; 왕초보 wr...
    • 강지영
    • 1999.05.14 01:10
    • 2 COMMENTS
    • /
    • 0 LIKES
    • 1999.05.14 01:29
      강지영 wrote: > ShellExecute 를 사용하려고 하는데 > 파라미터 전달하는 것을 모르겠습니다. > 예를 ...
    • 왕초보
      1999.05.14 01:27
      ShellExecute (Handle,'open', 'notepad','c:config.sys','',SW_SHOWNORMAL); 와 같이 파리미터...
    • 왕초보
    • 1999.05.14 00:02
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 이정욱
      1999.05.14 03:27
      아래의 문을 참고해서 디자인타임일경우에는 못하게 하시고 런타임인경우에만 실행하게 해보세요. if ...
    • 건맨
    • 1999.05.13 23:58
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 왕초보
      1999.05.14 00:07
      Interbase 를 설치하면 자동으로 깔리는 PDF문서를 참조하세요... 영문으로 되어 있지만 모두 출력을 하면...
    • 정용철
    • 1999.05.13 23:31
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 이정욱
      1999.05.14 03:34
      NMOCOD.DLL, NMORENU.DLL, NMSCKN.DLL, NMFTPSN.DLL, OLEPRO32.DLL 을 같이 배포하셔야 합니다. 복사만 ...
    • 은철수
    • 1999.05.13 22:25
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 은철수
      1999.05.14 02:00
      하윤철 wrote: > 같은 질문의 답을 델파이 팁페이지에서 구할수 있었습니다... > > http://board.membe...
    • 이호선
    • 1999.05.13 21:36
    • 1 COMMENTS
    • /
    • 0 LIKES
    • 이정욱
      1999.05.13 23:25
      NCHitTest 메세지가로채서 사용하는 방법과, 또 하나의 ReleaseCapture와 SendMessage를 사용하는 두가지 ...