| 发表于:2008-02-25 10:46:53 楼主 |
function getspecialfolderdir(const folderid: integer): string; var pidl: pitemidlist; buffer: array[0..255] of char; begin //取指定的文件夹项目表 shgetspecialfolderlocation(application.handle, folderid, pidl); shgetpathfromidlist(pidl, buffer); //转换成文件系统的路径 result := strpas(buffer); end; 调用: path := getspecialfolderdir(35)+'\mysoftware\'; 在xp下面是得到如下结果 path=c:\documents and settings\all users\application data\mysoftware\ 但在vistra下面得到的结果是这样的 path=c:\programdata\mysoftware\ 看啦下msdn 发现shgetspecialfolderlocation函数只能支持不支持vistra,郁闷哦! 这是msdn的解释 function information minimum dll version shell32.dll version 4.0 or later custom implementation no header shlobj.h import library shell32.lib minimum operating systems windows nt 4.0, windows 95 故在此请教高人,如何解决! 2008-02-25 |
|
|
|
|