我得到一个名为的字体文件的绝对 PIDL FontPIDL
我用这段代码打开它: var SheExeInfo : SHELLEXECUTEINFO;
begin
ZeroMemory(@ShExeInfo, SizeOf(ShExeInfo));
ShExeInfo.cbSize := SizeOf(ShExeInfo);
ShExeInfo.lpVerb := 'Open';
ShExeInfo.lpIDList := FontPIDL;
ShExeInfo.nShow := SW_SHOWNORMAL;
ShExeInfo.fMask := SEE_MASK_IDLIST;
end;
得到一个错误:The parameter is incorrect
我想知道如何解决它?是我想念的一些参数吗?
更新 :
我如何获得字体文件绝对 PIDL:
var
psfDeskTop : IShellFolder;
psfFont : IShellFolder;
pEnumList : IEnumIdList;
pidFont : PItemIdList;
pidChild : PItemIdList;
pidAbFont : PItemIdList;
FontPath : array[0..MAX_PATH - 1] of Char;
pchEaten, dwAttributes, ItemsFetched : ULONG;
begin
FillChar(FontPath, sizeof(FontPath), #0);
SHGetSpecialFolderPath(0, FontPath, CSIDL_FONTS, False);
SHGetDesktopFolder(psfDeskTop);
psfDeskTop.ParseDisplayName(0, nil, FontPath, pchEaten, pidFont,
dwAttributes);
psfDeskTop.BindToObject(pidFont, nil, IID_IShellFolder, psfFont);
psfFont.EnumObjects(0, SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or
SHCONTF_INCLUDEHIDDEN, pEnumList);
ItemsFetched := 0;
while pEnumList.Next(1, pidChild, ItemsFetched) = NO_ERROR do
begin
pidAbFont := ILCombine(pidFont , pidChild);
///... do something
end;
end;