How to Use DDE from FoxPro to Control Windows Program Manager

ID: Q132308

The information in this article applies to:

SUMMARY

This article shows by example how to use dynamic data exchange (DDE) to issue commands to the Microsoft Windows Program Manager from FoxPro for Windows.

The following commands are referenced in this article:

For a full explanation of these commands, please see Chapter 22, pages 19-22 of the "Microsoft Windows Software Development Kit Guide to Programming," version 3.1.

MORE INFORMATION

Step-by-Step Example

1. Use the following command to open a DDE channel to the Windows Program

   Manager:

   iChannel=DDEInitiate("Progman", "Progman")

2. Use the following command to create a new program group named Test
   Group:

   =DDEExecute(iChannel,"[CreateGroup(Test Group)]")

3. Use the following ShowGroup command (,7) to minimize Test Group to an
   icon:

   =DDEExecute(iChannel,"[ShowGroup(Test Group, 7)]")

4. Use the following ShowGroup command (,1) to expand Test Group, and
   make it the active group:

   =DDEExecute(iChannel,"[ShowGroup(Test Group, 1)]")

5. Use the following command to add an item to Test Group (The Readme.txt
   file from the the FoxPro for Windows root directory) with an icon:

   =DDEExecute(iChannel,"[AddItem(C:\fpw26\readme.txt,;
          FoxPro for Windows ReadMe,;
          C:\fpw26\goodies\fox\help.ico,0)]")

   NOTE: The AddItem option adds the program item to the active group (see
   step 4).

6. Use the following command to delete Test Group:

   =DDEExecute(iChannel,"[DeleteGroup(Test Group)]")

7. Use the following command to terminate the DDE Channel:

   =DDETerminate(iChannel)

REFERENCES

For more information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q114228
   TITLE     : How to Add Icons After Distributed Setup Program Is Run

Also see the Microsoft FoxPro for Windows Developer's Guide, Chapter 12, "Dynamic Data Exchange," and see the Microsoft Windows Software Development Kit (SDK) Programmer's Reference, Volume 1, Overview, Version 3.1, Chapter 17.2, "Command-String Interface."

Additional reference words: 2.60 2.60a FoxWin KBCategory: kbinterop KBSubcategory: FxinteropDde

Last Reviewed: July 10, 1995