Help with using DDE to add a program icon

I tried many times to add a program icon using DDE, but I always get some
errors from delphi.

I dont know what is wrong with the code below, could any of you (help me
please) have a look?

I placed a TDdeClientConv on my form and set the Service as ProgMan

procedure TForm1.FormCreate(Sender: TObject);
begin
CreateGroup('Program DDE Test');
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
DeleteGroup('Program DDE Test');
end;

{
This function here does not work properly, sometimes I can see a icon,
after I close down the program, but not immediately

Quote
}

function TForm1.AddItem(ExePath, Name : String) : boolean;
var PMacro : PChar;
        Macro : String;
  R : boolean;
begin

  StrPCopy (PMacro,  '[AddItem(' + ExePath + ',' + Name + ', , , , )]' +
#13#10);
  R := FDDEConvert.ExecuteMacro(PMacro, True);
  if not R then
    ShowMessage('Unable to add program item: ' + Name)
  Result := R;

end;

{
Works fine

Quote
}

function TForm1.CreateGroup(Name : String) : boolean;
var
  Cmd: PChar;
  Macro: string;
begin
  Macro := ('[CreateGroup(' + Name + ')]') + #13#10;
  StrPCopy (Cmd, Macro);
  Result := FDDEConvert.ExecuteMacro(Cmd, False);
end;

{
Cause me a serious error, memery accessing error, something like that.

Quote
}

unction TForm1.DeleteGroup(Name : String) : boolean;
var
        PMacro: PChar;
  Macro : String;
begin
        Macro := '[DeleteGroup(' + Name + ')]' + #13#10;
  StrPCopy (PMacro, Macro);
  Result := FDDEConvert.ExecuteMacro(PMacro, False);
end;

Thank you for any help.