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
- Use the following command to open a DDE channel to the Windows Program
Manager:
iChannel=DDEInitiate("Progman", "Progman")
- Use the following command to create a new program group named Test
Group:
=DDEExecute(iChannel,"[CreateGroup(Test Group)]")
- Use the following ShowGroup command (,7) to minimize Test Group to an
icon:
=DDEExecute(iChannel,"[ShowGroup(Test Group, 7)]")
- Use the following ShowGroup command (,1) to expand Test Group, and
make it the active group:
=DDEExecute(iChannel,"[ShowGroup(Test Group, 1)]")
- 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).
- Use the following command to delete Test Group:
=DDEExecute(iChannel,"[DeleteGroup(Test Group)]")
- 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."
|