CreatePMIcon

Description:

baCreatePMIcon creates a Start Menu icon.

Platforms:

Windows

Usage:

Result = baCreatePMIcon( Command, Title, Icon, IconNumber )

Arguments:

String, string, string, integer.
Command is the command line to use in the icon.
Title is the name that appears under the icon.
Icon is the name of the icon to use.
IconNumber is the number of the icon to use.

Returns:

Integer.
Returns 1 if successful, else 0.

Examples:

Director:
OK = baCreatePMIcon( "d:\mterms.exe", "Multimedia Terms" , "d:\mterms.ico" , 0 )

Authorware:
OK := baCreatePMIcon( "d:\\mterms.exe", "Multimedia Terms" , " d:\\mterms.ico" , 0 )
 

Notes:

The icon will be added to the active Start Menu group. To ensure that the group you want to add the icon to is active, you should always call baCreatePMGroup or baCreatePMCommonGroup before you use this function (even if the group already exists). This will make the group the active one. If you are adding multiple icons, you only need to make one call to baCreatePMGroup or baCreatePMCommonGroup before you start adding icons.

If you create a group, and want to add icons to it, you should allow enough time for Windows to create the group before you try to add an icon to it. A wait of one second should be enough, but slow machines running Win95 may take longer.

The Icon parameter can be either an .ico, .exe or .dll file. If the file is a .ico, then the IconNumber parameter is ignored. If it is a .exe or .dll file, then the IconNumber is the number of the icon in that file to use. If the Icon is an empty string (""), then the first icon in the Command .exe file will be used.

For example:

baCreatePMIcon( "d:\mterms.exe", "Multimedia Terms" , "" , 0 )

will use the default icon for d:\mterms.exe.

baCreatePMIcon( "d:\mterms.exe", "Multimedia Terms" , "d:\mterms.ico" , 0 )

will use the d:\mterms.ico icon.

baCreatePMIcon( "d:\mterms.exe", "Multimedia Terms" , "c:\windows\moreicons.dll" , 5 )

will use the fifth icon in moreicons.dll.

You need to ensure that the filenames you pass into the function do not contain a space use the baShortFilename function to return the short version of a filename.

 

See also:

baCreatePMGroup
baDeletePMGroup
baPMGroupList
baPMSubGroupList
baDeletePMIcon
baPMIconList