Article View: cn.bbs.comp.program
Article #1019Re: How to do(2)
From: ��
Date: Sun, 26 Apr 1998 00:00
Date: Sun, 26 Apr 1998 00:00
54 lines
2214 bytes
2214 bytes
> [1;36m==> Early_Chou(����װ��) ˵��: [37;40m[0m //admire Eaarly Chou but ���������������������,Ӳ��,����,��������������? > �������Win95��,�����������Shell APIȡ�����е�Drive��. > ��������Delphi 3��д��һ�δ���: > uses ShlObj; > procedure TForm1.Button1Click(Sender: TObject); > var > shf,shfDrv:IShellFolder; > pidl:PItemIDList; > enum:IEnumIDList; > f:integer; > StrRet:TStrRet; > s:string; > inout:integer; > begin > SHGetSpecialFolderLocation(Handle,CSIDL_DRIVES,pidl); > SHGetDesktopFolder(shf); > shf.BindToObject(pidl,nil,IID_IShellFolder,Pointer(shfDrv)); > shfDrv.EnumObjects(Handle,32,enum); > ListBox1.Items.Clear; > while enum.Next(1,pidl,f)=S_OK do > begin > // We only want Drives, no Control Panel and Printer included. > inout:=SFGAO_FILESYSTEM; > shfDrv.GetAttributesOf(1,pidl,inout); > if inout and SFGAO_FILESYSTEM=0 then > continue; > // Retrieve names of drives. > shfDrv.GetDisplayNameOf(pidl,1,StrRet); > case StrRet.uType of > STRRET_CSTR: s:=StrRet.cStr; > STRRET_WSTR: s:=StrRet.pOleStr; > STRRET_OFFSET: s:=PChar(@pidl.mkid)+StrRet.uOffset; > else s:=''; > end; > > // Append drive name to ListBox > ListBox1.Items.Add(S); //ȡ�õ����ַ����б��ListBox1��. > end; > end; > ���ҵĻ����ϲ���Ľ������: > 3.5����(A:) > System(C:) > Languages(D:) > Favorates(E:) > Languages(J:) \ > Languages(K:) / Substed Drives -- �� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID:
<980426.yTJQ0$PBBS@bbs.ustc.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: fc86e,1ded90a1f2f5231c,start X-Google-Attributes: gidfc86e,public From: Lll_Ccc@bbs.ustc.edu.cn (С��) Subject: Re: How to do(2) Date: 1998/04/26 Message-ID: <980426.yTJQ0$PBBS@bbs.ustc.edu.cn> X-Deja-AN: 347775883 Organization: �й�ƴ�BBSվ Newsgroups: cn.bbs.comp.program