creating a program manager icon

Can anyone tell me whats whong with this code?? it works fine (well a
little differentof course :) to create program groups.. but I can't create
an icon inside the group..

any help appreciated..

please email replies

thanx to all in advance

joe

procedure docreateprogitem(prgcmd : string;
                           prgtitle : string);
var
  Name: string;
  Macro: string;
  Cmd: array[0..255] of Char;
begin
  if prgcmd <> '' then
  begin
    main.DDEClient.OpenLink;

    Macro := Format('[ReplaceItem(%s)]', [prgtitle]) + #13#10;
    StrPCopy (Cmd, Macro);

     if not main.DDEClient.ExecuteMacro(Cmd, False) then
      MessageDlg('Unable to replace program.', mtInformation, [mbOK], 0);

    Macro := Format('[AddItem(%s,%s,,,)]', [prgcmd,prgtitle]){ + #13#10};
    StrPCopy (Cmd, Macro);
    if not main.DDEClient.ExecuteMacro(Cmd, False) then
      MessageDlg('Unable to create program.', mtInformation, [mbOK], 0);

    main.DDEClient.CloseLink;
  end;
end;