2010. 9. 13. 02:51
ShellExecute()는 윈도우쉘 명령을 실행시킬 때 쓰는 함수이다.
내가 사용하는 용도는 두가지이다.
한가지는 탐색기를 열 때(지정한 폴더로 이동시키는 것 까지),
나머지 한가지는 파일(윈도우즈 확장자 연결 프로그램으로 등록된 확장자를 가진 파일)을 열 때 이다.
먼저 탐색기를 여는 방법이다.
ShellExecute(0, 'explore', PChar(descDir), nil, nil, SW_SHOWNORMAL);
다음으로 파일을 열 때 이다.
var
fileFullPath : String;
errCode : Cardinal;
begin
errCode := ShellExecute(handle, 'open', Pchar(fileFullPath) , nil, nil, SW_SHOW);
if errCode = 31 then ShowMessage('HWP가 설치되어 있지 않습니다'); //실행화일 없을때
if errCode = 2 then ShowMessage('파일이 존재하지 않습니다'); //파일 없을때
end;
'Windows Programming > Delphi 6/7' 카테고리의 다른 글
Delphi6/7 Virtual Key Codes (0) | 2010.09.13 |
---|---|
Delphi6/7 디렉토리(폴더) 다이알로그, 폴더속에 있는 파일들 복사하기 (0) | 2010.09.13 |
Delphi6/7 TADOQuery - Binary 조회 (0) | 2010.09.13 |
Delphi6/7 TADOQuery - 기본적인 조회 코드 조각 (0) | 2010.09.13 |
Delphi6/7 TDBGrid - Column autoFit Implementation (0) | 2010.09.13 |