How to Use DDE from FoxPro to Control Windows Program Manager

Last reviewed: July 10, 1995
Article ID: Q132308
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.6 and 2.6a

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:

  • CreateGroup(groupname)
  • ShowGroup(groupname, showcommand)
  • Additem(command line,item name,icon path,X position,Y position)
  • DeleteGroup(groupname)

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 10, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.