Simple(?) DDE problem

Quote wrote:
>Could somebody please help me on this one.

>I want to list all progman groups in a listbox. According to the winapi
>help you have to read the Groups item. I've tried setting up a
>DDEClientItem but can't get it to work.

        Right. Put a DDEClientConv on the form, set the
DDEService and the DDETopic to Progman. Set the ServiceApplication
to progman.exe.

        Add a memo and a listbox to the form and now do

procedure TForm1.Button1Click(Sender: TObject);
  TheData: PChar;
if DDEClientConv1.OpenLink  then
  TheData := DDEClientConv1.RequestData('Groups');

        This works for me - if it doesn't work for you I maybe
left out a detail. What you get is a list of group names separated
by carriage returns, which is fine if for some reason you want to
display the names in the memo - if (of course) you want the
listbox instead you need to parse the string into a list.

        IF you have ConnectMode:=ddeAutomatic then you
can omit the OpenLink and the CloseLink. Of course for this
application ddeManual makes more sense.

        Here's a funny thing: This took a few tries, because I
thought that saying

TheData := DDEClientConv1.RequestData(DDEClientItem1.DDEItem);

should work, but it doesn't seem to.

David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...