I want to use SHGetFileInfo
to get windows control panel icon,I use Shell to get windows control panel
Code:
var
psfDeskTop: IShellFolder;
psfWork: IShellFolder;
pidworkDir: PITEMIDLIST;
pidChild: PITEMIDLIST;
pEnumList: IEnumIDList;
celtFetched: ULONG;
//chEaten, dwAttributes: ULONG;
FileInfo: SHFILEINFOW;
//conGUID: string;
StrRetName: TStrRet;
Name: PChar;
begin
SHGetDesktopFolder(psfDeskTop);
SHGetSpecialFolderLocation(0, CSIDL_CONTROLS, pidworkDir);
psfDeskTop.BindToObject(pidworkDir, nil, IID_IShellFolder, psfWork);
psfWork.EnumObjects(0, SHCONTF_NONFOLDERS or SHCONTF_FOLDERS or SHCONTF_INCLUDEHIDDEN, pEnumList);
while pEnumList.Next(1, pidChild, celtFetched) = 0 do
begin
//here I want to use SHGetFileInfo to get file icon
//but , SHGetFileInfo need a absolute PIDL,IEnumIDList enumerates relative PIDL
end
end;
I found a function called ILCombine in MSDN to do that , but I can't found in Delphi , I wonder if possible to combine pidworkDir and pidChild to get a absolute PIDL in Delphi?
Or is there any other way to get a file's icon?