Q&A

  • 특정폴더가 열린 상태로 탐색기 실행하는 법??
델파이로 탐색기를 실행시킬때 특정 폴더가 열린(선택) 상태로



탐색기를 어떻게 실행 시키죠...>>>





1  COMMENTS
  • Profile
    김영대 1999.06.24 18:53
    박지수 께서 말씀하시기를...

    > 델파이로 탐색기를 실행시킬때 특정 폴더가 열린(선택) 상태로

    >

    > 탐색기를 어떻게 실행 시키죠...>>>



    unit Unit1;



    interface



    uses

    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    StdCtrls, ShellAPI;



    type

    TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

    private

    { Private declarations }

    public

    { Public declarations }

    end;



    var

    Form1: TForm1;



    implementation

    {$R *.DFM}



    procedure TForm1.Button1Click(Sender: TObject);

    var

    Cur_Dir: String;

    begin

    // 이 프로그램의 실행된 디렉토리 얻기

    Cur_Dir := ExtractFilePath(ParamStr(0));



    // 디렉토리가 open된 탐색기 실행

    ShellExecute(0, 'explore',

    PChar(Cur_Dir),

    nil,

    nil,

    SW_SHOWNORMAL);

    end;



    end.