음...
답변이라기 보다는... 저도 그 문제로 고민좀 했었는데...
분명 가능합니다. 하지만 좀 까다로운 몇가지 문제를
해결해야 하죠...
암튼...
SHGetSpecialFolderLocation 라는 API 함수가 있습니다.
이 함수를 잘 사용하시면 쉽게 구현하실 수도 있죠...
간단히 이 함수를 이용한 예제를 만들어 봤습니다.
참고하세요...
uses
ActiveX, ShellAPI, ShlObj;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
ppidl : PItemIDList;
lpExecInfo : TShellExecuteInfo;
ppMalloc : IMalloc;
begin
if SUCCEEDED ( SHGetMalloc ( ppMalloc ) )
then if SUCCEEDED ( SHGetSpecialFolderLocation ( 0,
CSIDL_DRIVES,
ppidl ) )
then begin
with lpExecInfo do
begin
cbSize := SizeOf ( TShellExecuteInfo );
fMask := SEE_MASK_IDLIST;
lpVerb := 'open';
nShow := SW_NORMAL;
lpIDList := ppidl;
end;
ShellExecuteEx ( @lpExecInfo );
ppMalloc.Free ( ppidl );
end
else {}
else begin
ppMalloc._Release;
ppMalloc := nil;
end;
end;
end.
|