各位大侠:我想在windwos程序菜单中创建多层的快捷方式(我不知道是不是该这样叫,如果有谁知道请告诉我)。举个例子:开始--程序--短信--短信软件/卸载短信软件。也就是说,要创建“短信”这个快捷方式,
然后在这个快捷方式中,创建“短信软件”和“卸载短信软件”两个快捷方式。如何实现,请给出例子。高分送。

解决方案 »

  1.   

    http://community.borland.com/article/0,1410,16597,00.htmlunit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}uses
      ShlObj, ActiveX, ComObj, Registry;procedure TForm1.Button1Click(Sender: TObject);
    var
      MyObject  : IUnknown;
      MySLink   : IShellLink;
      MyPFile   : IPersistFile;
      FileName  : String;
      Directory : String;
      WFileName : WideString;
      MyReg     : TRegIniFile;
    begin
      MyObject := CreateComObject(CLSID_ShellLink);
      MySLink := MyObject as IShellLink;
      MyPFile := MyObject as IPersistFile;
      FileName := 'NOTEPAD.EXE';
      with MySLink do begin
        SetArguments('C:\AUTOEXEC.BAT');
        SetPath(PChar(FileName));
        SetWorkingDirectory(PChar(ExtractFilePath(FileName)));
      end;
      MyReg := TRegIniFile.Create(
        'Software\MicroSoft\Windows\CurrentVersion\Explorer');// Use the next line of code to put the shortcut on your desktop
      Directory := MyReg.ReadString('Shell Folders','Desktop','');// Use the next three lines to put the shortcut on your start menu
    //  Directory := MyReg.ReadString('Shell Folders','Start Menu','')+
    //      '\Whoa!';
    //  CreateDir(Directory);  WFileName := Directory+'\FooBar.lnk';
      MyPFile.Save(PWChar(WFileName),False);
      MyReg.Free;
    end;end.
      

  2.   

    http://www.delphibbs.com/delphibbs/dispq.asp?lid=96903