原来摘自本站,看原贴请用给出的ID<br><br>如何得到desktop, my computer等虚拟目录的guid? ( 积分:88, 回复:7, 阅读:42 )<br>分类:系统相关 ( 版主:luyear, zyy04 ) <br>来自:qevan, 时间:2003-3-12 1:10:00, ID:1673954 [显示:小字体 | 大字体] <br>最好有实例。<br> <br> <br>来自:adminmaker, 时间:2003-3-12 3:04:00, ID:1673987 <br>up<br> <br> <br>来自:qevan, 时间:2003-3-12 23:11:00, ID:1676929 <br>re一把,<br>本文在csdn也问了,但就是没人回答,<br><br> <br> <br>来自:小雨哥, 时间:2003-3-13 4:03:00, ID:1677066 <br>在 ShlObj 单元,自己去看。所有 CSIDL 开头的,共 35 个。<br> <br> <br>来自:小雨哥, 时间:2003-3-13 4:12:00, ID:1677067 <br>干脆让你看仔细了:<br>-------------------------------------------------------------------------------<br>uses ShlObj;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>const<br> Folder:array[0..34] of string=('CSIDL_DESKTOP',<br> 'CSIDL_INTERNET',<br> 'CSIDL_PROGRAMS',<br> 'CSIDL_CONTROLS',<br> 'CSIDL_PRINTERS',<br> 'CSIDL_PERSONAL',<br> 'CSIDL_FAVORITES',<br> 'CSIDL_STARTUP',<br> 'CSIDL_RECENT',<br> 'CSIDL_SENDTO',<br> 'CSIDL_BITBUCKET',<br> 'CSIDL_STARTMENU',<br> 'nil-13','nil-14','nil-15','nil-16',<br> 'CSIDL_DESKTOPDIRECTORY',<br> 'CSIDL_DRIVES',<br> 'CSIDL_NETWORK',<br> 'CSIDL_NETHOOD',<br> 'CSIDL_FONTS',<br> 'CSIDL_TEMPLATES',<br> 'CSIDL_COMMON_STARTMENU',<br> 'CSIDL_COMMON_PROGRAMS',<br> 'CSIDL_COMMON_STARTUP',<br> 'CSIDL_COMMON_DESKTOPDIRECTORY',<br> 'CSIDL_APPDATA',<br> 'CSIDL_PRINTHOOD',<br> 'CSIDL_ALTSTARTUP','nil-30',<br> 'CSIDL_COMMON_ALTSTARTUP',<br> 'CSIDL_COMMON_FAVORITES',<br> 'CSIDL_INTERNET_CACHE',<br> 'CSIDL_COOKIES',<br> 'CSIDL_HISTORY');<br>var<br> PIIDList
ItemIDList;<br> PPath:array[0..255]of Char;<br> i:integer;<br>begin<br> for i:=0 to 34 do<br> begin<br> ZeroMemory(@PPath,256); <br> SHGetSpecialFolderLocation(self.Handle,i,PIIDList);<br> SHGetPathFromIDList(PIIDList,@PPath);<br> Memo1.Lines.Add(Folder
+' : '+StrPas(@PPath));<br> end;<br>end;<br> <br> <br>来自:qevan, 时间:2003-3-13 16:34:00, ID:1679075 <br>谢谢,但我要的不是这个。<br>我想得到特殊目录的guid,<br>eg:{208D2C60-3AEA-1069-A2D7-08002B30309D}网上邻居<br>{20D04FE0-3AEA-1069-A2D8-08002B30309D}我的电脑<br>如何得到上面的guid?<br>比如通过 CSIDL 开头的那35个常量得到对应的guid.<br><br><br> <br> <br>来自:小雨哥, 时间:2003-3-13 19:52:00, ID:1679631 <br>CLSID_NetworkPlaces:TGUID={'208D2C60-3AEA-1069-A2D7-08002B30309D'};<br>CLSID_NetworkDomain:TGUID={'46e06680-4bf0-11d1-83ee-00a0c90dc849'};<br>CLSID_NetworkServer:TGUID={'c0542a90-4bf0-11d1-83ee-00a0c90dc849'};<br>CLSID_NetworkShare:TGUID={'54a754c0-4bf1-11d1-83ee-00a0c90dc849'};<br>CLSID_MyComputer:TGUID={'20D04FE0-3AEA-1069-A2D8-08002B30309D'};<br>CLSID_Internet:TGUID={'871C5380-42A0-1069-A2EA-08002B30309D'};<br>CLSID_ShellFSFolder:TGUID={'F3364BA0-65B9-11CE-A9BA-00AA004AE837'};<br>CLSID_RecycleBin:TGUID={'645FF040-5081-101B-9F08-00AA002F954E'};<br>CLSID_ControlPanel:TGUID={'21EC2020-3AEA-1069-A2DD-08002B30309D'};<br>CLSID_MyDocuments:TGUID={'450D8FBA-AD25-11D0-98A8-0800361B1103'};<br>CLSID_ShellDesktop:TGUID={'00021400-0000-0000-C000-000000000046'};<br>CLSID_ShellLink:TGUID={'00021401-0000-0000-C000-000000000046'};<br> <br> <br>来自:小雨哥, 时间:2003-3-13 19:59:00, ID:1679658 <br>看不清谁是谁的话,一个简单的办法是在桌面上新建一个文件夹,然后重命名时代入 GUID:<br>例如:把一个文件夹重命名为 X.{645FF040-5081-101B-9F08-00AA002F954E} ,就可以知道<br>这个 GUID 代表谁了。(本例是回收站)