Q: How do I initialte a DDE link to the program manager to create a new group?
A: Here it is from c:\delphi\demos\dde\ddedemo.dpr:
var
Name: string;
Macro: string;
Cmd: array[0..255] of Char;
begin
if GroupName.Text = '' then {an edit field on the form}
MessageDlg('Group name can not be blank.', mtError,
[mbOK], 0)
else
begin
Name := GroupName.Text;
Macro := Format('[CreateGroup(%s)]', [Name]) + #13#10;
StrPCopy (Cmd, Macro);
DDEClient.OpenLink;
if not DDEClient.ExecuteMacro(Cmd, False) then
MessageDlg('Unable to create group.',
mtInformation, [mbOK], 0);
DDEClient.CloseLink;
GroupName.SelectAll;
end;
end;