uses ActiveX, ShlObj, ...;
// ...
var
pidl, pidlSelected: PItemIDList;
ABrowserInfo: TBrowseInfo;
szDirName: array [0..260] of AnsiChar;
begin
{Get the root PIDL of the network neighborhood tree}
if SHGetSpecialFolderLocation(Handle, CSIDL_DESKTOP, pidl) = NOERROR then
begin
{Populate a BROWSEINFO structure}
ABrowserInfo.hwndOwner :=Handle;
ABrowserInfo.pidlRoot :=pidl;
ABrowserInfo.pszDisplayName :=szDirName;
ABrowserInfo.lpszTitle :='Select directory';
ABrowserInfo.ulFlags :=BIF_RETURNONLYFSDIRS or BIF_NEWDIALOGSTYLE;
ABrowserInfo.lpfn :=nil;
ABrowserInfo.lParam :=0;
ABrowserInfo.iImage :=- 1;
{Display the "Browse For Folder" dialog box}
pidlSelected := SHBrowseForFolder(ABrowserInfo);
{NULL indicates that Cancel was selected from the dialog box}
if pidlSelected <> nil then
begin
SHGetPathFromIDList(pidlSelected, szDirName);
// szDirName 처리...
{Release the PIDL of the computer name}
CoTaskMemFree(pidlSelected);
end;
{Release the PIDL of the network neighborhood tree}
CoTaskMemFree(pidl);
end;
'프로그래밍 > 델파이' 카테고리의 다른 글
Intel Architecture Manual (0) | 2007.12.22 |
---|---|
창 닫기(Alt + F4) 막기 (0) | 2007.12.22 |
비트맵 이미지를 회전하는 메소드 (0) | 2007.12.22 |
플래쉬에 값 설정하기 (0) | 2007.12.22 |
원하는 프로세스 찾기 / 프로세스 경로 얻기 (0) | 2007.12.22 |