1. How can I get a list of control panels, including their names and icons, so I can create a menu like the one the Start menu shows?
2. When I click an entry, how do I execute the corresponding control panel?
By the way, what controls are used to do this kind of PopupMenu? But it has right click event.
update :
I use PItemIDList to get a Folder:
var:
PIDL, TempPIDL: PItemIDList;
Path: array[0..MAX_PATH] of Char;
FI: SHFILEINFOW;
begin
SHGetSpecialFolderLocation(0, CSIDL_FAVORITES, PIDL);
SHGetPathFromIDList(PIDL , Path);
Memo1.Lines.Add(Path);
SHGetFileInfo(LPCTSTR(PIDL), 0, FI, SizeOf(FI), SHGFI_PIDL or SHGFI_DISPLAYNAME or SHGFI_ICON);
Memo1.Lines.Add(FI.szDisplayName);
Image1.Picture.Icon.Handle := FI.hIcon;
it display normal , but when I change CSIDL_FAVORITE to CSIDL_CONTROLS , I always get error .
this is a wrong way to get controls panel items ?
I also use another method by use CPL
copy from here
But it can not display complete Items.
In your help, I solved the problem! Special thanks to David Heffernan
1.Get control panel items I use Windows Shell to get control panel items , use CPL files not get complete items .
Code :
2. Execute must have to use
ShellExecuteEx
to execute a PIDL item.and use
Finally thanks to David Heffernan again. help me a lot.