1 用GetWindowsDirectory获取Windows的路径,再替换成Program Files 2 uses ShellCtrls; procedure TForm1.Button1Click(Sender: TObject); var i:integer; ShellListView1:TShellListView; begin ShellListView1:=TShellListView.Create(self); ShellListView1.ParentWindow:=Application.Handle; ShellListView1.Root:='rfPrograms';//或 'rfCommonPrograms'是有区别的 for i:=0 to ShellListView1.Items.Count-1 do begin if ShellListView1.Folders[i].IsFolder then Memo1.Lines.Add(ShellListView1.Folders[i].DisplayName);//添加到Memo中 end; ShellListView1.Free; end; 3 开始菜单的路径也可以在注册表中读出:HKEY_CURRENT_USER\Software\MicroSoft\Windows\CurrentVersion\Explorer\Shell Folder programs里面 只要在这个路径进行创建文件夹、创建快捷方式就行了。
2 uses ShellCtrls;
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
ShellListView1:TShellListView;
begin
ShellListView1:=TShellListView.Create(self);
ShellListView1.ParentWindow:=Application.Handle;
ShellListView1.Root:='rfPrograms';//或 'rfCommonPrograms'是有区别的
for i:=0 to ShellListView1.Items.Count-1 do
begin
if ShellListView1.Folders[i].IsFolder then
Memo1.Lines.Add(ShellListView1.Folders[i].DisplayName);//添加到Memo中
end;
ShellListView1.Free;
end;
3 开始菜单的路径也可以在注册表中读出:HKEY_CURRENT_USER\Software\MicroSoft\Windows\CurrentVersion\Explorer\Shell Folder
programs里面
只要在这个路径进行创建文件夹、创建快捷方式就行了。