Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 팁&트릭
Delphi Programming Tip&Tricks
[57] 확장자로 연결 프로그램 알아내기.
civilian,안영제 [civilian] 4904 읽음    2005-06-02 19:46
탐색기에서 파일을 더블클릭하면 연결된 프로그램이 동작하게 되는데,
이는 레지스트리에 정보가 기록되어 있기 때문입니다.
아래 팁은 파일의 확장자로 연결된 응용 프로그램이 무엇인지 알아내는 방법입니다.

(출처) http://delphi.about.com

Uses Registry;

function GetExeByExtension(sExt : string) : string;
var
   sExtDesc:string;
begin
   with TRegistry.Create do
   begin
     try
       RootKey:=HKEY_CLASSES_ROOT;
       if OpenKeyReadOnly(sExt) then
       begin
         sExtDesc:=ReadString('') ;
         CloseKey;
       end;
       if sExtDesc <>'' then
       begin
         if OpenKeyReadOnly(sExtDesc + '\Shell\Open\Command') then
         begin
           Result:= ReadString('') ;
         end
       end;
     finally
       Free;
     end;
   end;

   if Result <> '' then
   begin
     if Result[1] = '"' then
     begin
       Result:=Copy(Result,2,-1 + Pos('"',Copy(Result,2,MaxINt))) ;
     end
   end;
end;

+ -

관련 글 리스트
57 확장자로 연결 프로그램 알아내기. civilian,안영제 4904 2005/06/02
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.