用代码说:

解决方案 »

  1.   

    在Form上添加一个System面板里的DdeClientConv控件。DdeClientConv1.OpenLink;
    DdeClientConv1.ExecuteMacro(pchar('[CreateGroup(公司名称)]'),False);
        DdeClientConv1.ExecuteMacro(pchar('[AddItem("'+Edit1.Text+'\TransOrder.exe",托运单录入软件)]'),false);
      

  2.   

    uses Shlobj, ActiveX, ComObj;procedure CreateLnk(LnkName:string);
    var
        AnObj:IUnknown;
        ShLink:IShellLink;
        PFile:IPersistFile;
        FileName:string;
        WFileName:WideString;
        Reg:TRegIniFile;
    begin
        //access the two interface of the object
        AnObj:=CreateComObject(CLSID_ShellLink);
        ShLink:=Anobj as IShellLink;
        PFile:=Anobj as IPersistFile;    //get the name of the application file
        FileName:=Paramstr(0);
        //set the link properties
        ShLink.SetPath(pchar(FileName));
        ShLink.SetWorkingDirectory(PChar(ExtractFilePath(FileName)));
        //save the file in the current dir
        //useing a widestring
        WFileName:=ExtractFilePath(FileName)+LnkName+'.lnk';
        PFile.Save(pwchar(WFileName),false);
        //save on the desktop
        reg:=TRegIniFile.Create('Software\MicroSoft\Windows\CurrentVersion\explorer');
        WFileName:=Reg.ReadString('Shell Folders','Desktop','')+'\'+LnkName+'.lnk';
        reg.free;
        PFile.Save(PWChar(WFileName),false);
        //save in the start menu
        reg:=TRegIniFile.Create('Software\MicroSoft\Windows\CurrentVersion\explorer');
        WFileName:=Reg.ReadString('Shell Folders','Start Menu','')+'\'+LnkName+'.lnk';
        reg.free;
        PFile.Save(PWChar(WFileName),false);
    end;
      

  3.   

    对头!只要实现SHELL提供的IShellLink;IPersistFile;两个接口,你可以完成所有的快捷方式方面的应用了,应该说这是COM最简单的应用了