The information in this article applies to:
SUMMARYDynamic-data exchange (DDE) can be used to obtain group and/or item information from Program Manager. Many applications, especially setup applications, need this information before items or groups are added/deleted from Program Manager. Information such as group names, group filenames, the number of items in a group, an item's working directory, title, xpos, ypos, and so forth, can be obtained very easily from Program Manager through DDE. This article discusses how to obtain this type of information from Program Manager using DDEML. MORE INFORMATION
Program Manager is a DDEML server that provides DDE client
applications with valuable information regarding group windows and
items inside the group windows.
Group InformationTo obtain names of all the groups currently in Program Manager, the client has to issue a request transaction with the item name set to "GROUPS". The request has to be made in CF_TEXT format.The return value from this transaction is a data handle that contains the names of all the groups in Program Manager. Each group name is separated by a carriage return (\r\n). The following code sample requests names of all the groups from Program Manager:
If there are four groups in Program Manager (for example, Main,
Accessories, SDK, and Applications), then the message-box call will
display names of all these groups, one per line.
Item InformationTo obtain information regarding all the items in a group, the client application has to issue a request transaction to Program Manager, this time with the item name set to the name of the group. For example, if the client application needs to find out if an item exists in Program Manager group "Main", or if it needs to find out all the items that are in group Main, then the call to DdeCreateStringHandle() above must be changed to
to create a string handle for the appropriate item name, Main.
The return value from this transaction is a data handle that contains names of all the items in the group Main. A typical example of the data inside resembles the following:
Program Manager provides the list in CF_TEXT format. The fields of
group information are separated by commas. The first line of the
information contains the group name (in quotation marks), the path of
the group file, and the number of items in the group.
NOTE: The last value on line 1 is not documented in the Windows Software Development Kit (SDK); it can be any value between 1 and 8. This is the same value that is passed as the second param to the ShowGroup() command. This value indicates the state of the group window, whether minimized, active, and so forth. In this particular case, the group window Main is currently the active group and is maximized. For more information on this value, please refer to the ShowGroup() command documentation in Section 17.2.2 of the Windows 3.1 SDK "Programmer's Reference, Volume 1: Overview." Each subsequent line contains information about an item in the group, including the command line (in quotation marks), the default directory, the icon path, the position in the group, the icon index, the shortcut key (in numeric form), and the minimize flag. This set of information for each item corresponds to the parameters passed to the AddItem() function when each item was added to the group. For more information on each of these parameters, refer to the AddItem() command documentation on Section 17.2.5 of the Windows 3.1 SDK, "Programmer's Reference, Volume 1: Overview." Additional query words: GPF gp-fault
Keywords : kb16bitonly kbNTOS350 kbNTOS351 kbWinOS310 kbDSupport kbWinOS300 |
Last Reviewed: July 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |