«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

Communicate with Windows Program Manager using DDE

   

All the communications with the program manager of Windows has to be done with DDE (Dynamic Data Exchange). If you want to install a program icon to a Windows group you have to know something about DDE and the macro commands you can use.

procedure Form1.ProgManDDE(const MacroLines : TStrings);
  {sends a group of macro's to the program-manager}
begin
  DDEClient.OpenLink; 
  { DDEClient = name of the TDdeClientConv component }
  try 
    if not DDECLient.ExecuteMacroLines(MacroLines, False) then 
      MessageDlg(
        'Could not execute the DDE commands', mtInformation, [mbOk], 0
      );
  finally
    DDEClient.CloseLink;
    Application.BringToFront; 
  end;
end;

procedure Form1.ButStartUpClick(Sender: TObject);
  {button click event handler}
var
  lines: TStringList; 
  str: String;
begin 
  lines := TStringList.Create;
  Lines.Clear;
  { compose the macro commands } 
  str := Application.ExeName;
  Lines.Add('[CreateGroup(test group)]');
  Lines.Add('[AddItem(' + str + ', Reminder 2.0)]'); 
  { excute the macro commands }
  ProgmanDDE(lines);
  lines.free; 
end;
Author: Shlomo Abuisak
Contributor: Shlomo Abuisak
Added: 2009-11-05
Last updated: 2009-11-05

« Return to contents »