17.2.5 AddItem

The syntax for the AddItem command has this form:

AddItem(CmdLine[,
Name[,IconPath[,IconIndex[,xPos, yPos[,DefDir[,
HotKey,[,fMinimize] ] ] ] ] ] ])

The AddItem command instructs Program Manager to add an icon to an existing group.

Following are the parameters for this command:

CmdLine

Specifies the full command line required to execute the application. This parameter is a string. At a minimum, this string is the name of the executable file for the application. It can also include the full path of the application and any parameters required by the application.

Name

Specifies the title that is displayed below the icon in the group window.

IconPath

Identifies the filename for the icon to be displayed in the group window. This parameter is a string. This file can be either a Windows executable file or an icon file. If the IconPath parameter is not specified, Program Manager uses the first icon in the file specified by the CmdLine parameter if that file is an executable file. If CmdLine specifies an associated file, Program Manager uses the first icon of the associated executable file. The association is taken from the registration database. (For more information about the registration database, see Chapter 7, “Shell Library.”) If CmdLine specifies neither an executable file nor an associated executable file, Program Manager uses a default icon.

IconIndex

Specifies the index of the icon in the file identified by the IconPath parameter. The IconIndex parameter is an integer. PROGMAN.EXE contains five built-in icons that can be used for non-Windows programs.

xPos

Specifies the horizontal position of the icon in the group window. This parameter is an integer. You must use both the xPos and yPos parameters to specify the position of the icon. If you do not specify the position, Program Manager places the icon in the next available space.

yPos

Specifies the vertical position of the icon in the group window. This parameter is an integer. You must use both the xPos and yPos parameters to specify the position of the icon. If you do not specify the position, Program Manager places the icon in the next available space.

DefDir

Specifies the name of the default (or working) directory. This parameter is a string.

HotKey

Identifies a hot (or shortcut) key that is specified by the user.

fMinimize

Specifies whether an application window should be minimized when it is first displayed.