
This overview describes the dynamic data exchange (DDE) interface of Program Manager (Progman.exe). Program Manager is a shellthat is, an application that enables users to group, start, and otherwise control other applications for the Microsoft® Windows® operating system.
About Program Manager Initialization
Program Manager starts automatically when the user starts Windows and runs as long as Windows is in use. When it starts, Program Manager displays one or more windows within its main window. Each window contains icons that correspond to logically related Windows-based applications. For example, the Accessories window contains icons for Windows Write, Paintbrush, Notepad, and other accessory applications.
Program Manager stores initialization and configuration information in the registry. This information is stored under the Settings, Groups, and Restrictions keys in the following section of the registry:
HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\
CurrentVersion\Program Manager
Additional information is stored in the Program Groups key in the following section of the registry:
HKEY_LOCAL_MACHINE\SOFTWARE
The Settings key contains information that Program Manager uses to configure its environment. The following entries appear in the Settings key.
| Entry | Description |
| MinOnRun | Specifies whether to minimize Program Manager when an application is started. |
| AutoArrange | Specifies whether Program Manager should automatically arrange icons within groups. |
| SaveSettings | Specifies whether to save the position of the Program Manager window when Program Manager terminates. |
| Display.drv | Specifies the file name of the display driver in use when Program Manager last terminated. When Program Manager starts, it compares this value to the file name of the display driver currently in use. If the names are different, Program Manager re-extracts the application icons. |
| Window | Specifies the location and dimensions of the Program Manager window. |
| Order | Specifies the order that the groups listed in the Groups key appear in the Program Manager window. |
| Startup | Specifies the name of the startup group. Program Manager automatically starts the applications in this group whenever it starts. |
The windows that appear in the Program Manager window correspond to group files. From the user's perspective, a group file is a collection of icons that represent logically related applications, but from the programmer's perspective, a group file is actually a collection of data. This data includes the color information for the icons (AND and XOR masks), an offset to the resource header of each icon, the ideal resolution for displaying each icon, the name of the executable (.exe) file that contains the application, and so on.
There are two types of groups: common and personal. A common group is shared among multiple users through network connections; a personal group is not shared. Program Manager stores information about personal groups under the Groups key. It stores information about common groups under the HKEY_LOCAL_MACHINE\SOFTWARE key.
The Groups key of the registry identifies the names of the group files that Program Manager displays as unique windows or icons. The groups must be numbered, but they don't need to be listed in any particular order. Program Manager never changes the number of an existing group.
The Restrictions key controls whether certain features of Program Manager are enabled or disabled. The following entries can appear in the Restrictions key.
| Entry | Description | ||||||||||||
| NoRun | Specifies whether to disable the Run command on the File menu. If this entry is set to 1, the Run command is disabled. If this entry is set to 0, the Run command is enabled. The default is 0 if no value is specified. | ||||||||||||
| NoClose | Specifies whether to prevent the user from closing Program Manager through the File menu, the System menu, the ALT+F4 key combination, or the Task List. If this entry is set to 1, closing is prevented. If this entry is set to 0, closing is allowed. If no value is specified, the default is 0. | ||||||||||||
| EditLevel | Controls the extent to which the user can modify read/write groups. (Shared read-only groups cannot be modified.) This entry can be set to one of the following values.
| ||||||||||||
| NoFileMenu | Specifies whether to disable the File menu and all of its commands. If this entry is set to 1, the File menu is disabled. If this entry is set to 0, the menu is enabled. If no value is specified, the default setting is 0. | ||||||||||||
| NoSaveSettings | Specifies whether to disable the Save Settings on Exit command on the Options menu. If this entry is set to 1, the Save Settings on Exit command is disabled. If this entry is set to 0, the command is enabled. If no value is specified, the default setting is 0. |
Setting the value of NoRun to 1 and the value of EditLevel to 3 prevents a user from using Program Manager to run any applications not already in a program group.
Program Manager has a DDE command-string interface that allows other applications to create, display, delete, and reload groups; add items to groups; replace items in groups; delete items from groups; and close Program Manager. The following commands perform these actions:
| AddItem | ExitProgman |
| CreateGroup | Reload |
| DeleteGroup | ReplaceItem |
| DeleteItem | ShowGroup |
For example, the setup program for an application can use these commands to instruct Program Manager to install the application's icon in a group.
Multiple commands can be concatenated; each command must be contained in square brackets, and parameters must be contained in parentheses and separated by commas. Quotation marks must delimit arguments that contain spaces, brackets, or parentheses. For example, the following set of commands adds Winapp.exe to the Windows Applications group.
[CreateGroup("Windows Applications")]
[ShowGroup("My Group",1)]
[AddItem(winapp.exe,Win App,winapp.exe,2)]
To use these commands, an application must first initiate a DDE conversation with Program Manager. The application and topic names for the conversation are both Progman. The application then sends the WM_DDE_EXECUTE message, specifying the appropriate command and its parameters.
Note The user can configure Windows to use a shell other than Program Manager as the default. Therefore, do not design an application that assumes Program Manager will be available for a DDE conversation.
The following sections describe Program Manager DDE command strings in detail. In the syntax blocks in these sections, brackets enclose optional parameters.
AddItem(CmdLine[, Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[, HotKey[,fMinimize[fSeparateMemSpace] ] ] ] ] ] ])
Instructs Program Manager to add an icon to an existing group. There is a limit of 50 items per group.
CreateGroup(GroupName[,CommonGroupFlag])
Instructs Program Manager to create a new group or activate the window of an existing group.
If the second parameter of this command specifies the path of the group file (as was required in Windows version 3.1), the parameter is ignored.
DeleteGroup(GroupName[,CommonGroupFlag])
Instructs Program Manager to delete an existing group.
If the second parameter of this command specifies the path of the group file (as was required in Windows version 3.1), the parameter is ignored.
DeleteItem(ItemName)
Instructs Program Manager to delete an item from the currently active group.
ExitProgman(bSaveGroups)
Instructs Program Manager to terminate if started by another application and, optionally, save its group information.
Reload(GroupName[,CommonGroupFlag])
Instructs Program Manager to remove and reload an existing group. An application that modifies group files can use this command to cause Program Manager to update the groups when it has finished making modifications.
ReplaceItem(ItemName)
Instructs Program Manager to delete an item and record the position of the deleted item. Program Manager then adds a new item (specified by the next AddItem command) at this recorded position.
ShowGroup(GroupName,ShowCommand[,CommonGroupFlag])
Instructs Program Manager to minimize, maximize, or restore the window of an existing group.
| 1 | Activate and display the group window. If the window is minimized or maximized, Windows restores it to its original size and position. |
| 2 | Activate the group window and display it as an icon. |
| 3 | Activate the group window and display it as a maximized window. |
| 4 | Display the group window in its most recent size and position. The window that is currently active remains active. |
| 5 | Activate the group window and display it in its current size and position. |
| 6 | Minimize the group window. |
| 7 | Display the group window as an icon. The currently active window remains active. |
| 8 | Display the group window in its current state. The currently active window remains active. |
Program Manager can provide information about its groups to an application. Applications can request this information from Program Manager by using the Progman topic.
An application can obtain a list of Program Manager groups by issuing a request for the Group item. Program Manager provides the list in CF_TEXT format. The list consists of group name strings separated by carriage returns.
An application can use a group name as an item name to request information about the group. Program Manager provides this information 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. 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.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.