'VB3 & win3.x 'use as 'Call CreateProgManGroup(Form1,[groupname],[groupfile]) 'Call CreateProgManItem(Form1,[path&executablename],[iconname]) '------------------------------------------------------------- ' Procedure: CreateProgManGroup ' Arguments: X The Form where a Label1 exist ' GroupName$ A string that contains the group name ' GroupPath$ A string that contains the group file ' name ie 'myapp.grp' '------------------------------------------------------------- Sub CreateProgManGroup (xReturnas
Form, GroupName$, GroupPath$) Screen.MousePointer = 11 '---------------------------------------------------------------------- ' Windows requires DDE in order to create aprogram
group and item. ' Here, avisual
Basic label control is used to generate the DDE messages '---------------------------------------------------------------------- On Error Resume Next '-------------------------------- 'set
LinkTopic toprogram
MANAGER '-------------------------------- x.Label1.LinkTopic = "ProgMan|Progman" x.Label1.LinkMode = 2 For i% = 1 To 10 'loop
to ensure that there is enoughtime
to z% = DoEvents() ' process DDE Execute. This isredundant
but needed Next ' for debug windows. x.Label1.LinkTimeout = 100 '--------------------- ' Createprogram
group '--------------------- x.Label1.LinkExecute "[CreateGroup(" + GroupName$ + Chr$(44) + GroupPath$ + ")]" '----------------- ' Reset properties '----------------- x.Label1.LinkTimeout = 50 x.Label1.LinkMode = 0 Screen.MousePointer = 0 End Sub '---------------------------------------------------------- ' Procedure: CreateProgManItem ' ' Arguments: X The form where Label1 exists ' ' CmdLine$ A string that contains the command ' line for the item/icon. ' ie 'c:\myapp\setup.exe' ' ' IconTitle$ A string that contains the item's ' caption '---------------------------------------------------------- Sub CreateProgManItem (xas
Form, CmdLine$, IconTitle$) Screen.MousePointer = 11 '---------------------------------------------------------------------- ' Windows requires DDE in order to create aprogram
group and item. ' Here, avisual
Basic label control is used to generate the DDE messages '---------------------------------------------------------------------- On Error Resume Next '--------------------------------- 'set
LinkTopic toprogram
MANAGER '--------------------------------- x.Label1.LinkTopic = "ProgMan|Progman" x.Label1.LinkMode = 2 For i% = 1 To 10 'loop
to ensure that there is enoughtime
to z% = DoEvents() ' process DDE Execute. This isredundant
but needed Next ' for debug windows. x.Label1.LinkTimeout = 100 '------------------------------------------------ ' Createprogram
Item, one of the icons to launch ' an application fromprogram
Manager '------------------------------------------------ ' Win 3.1 has a ReplaceItem, which will allow us to replace existing icons x.Label1.LinkExecute "[ReplaceItem(" + IconTitle$ + ")]" x.Label1.LinkExecute "[AddItem(" + CmdLine$ + Chr$(44) + IconTitle$ + Chr$(44) + ",,)]" x.Label1.LinkExecute "[ShowGroup(groupname, 1)]" ' This will ensure thatprogram
manager
does not ' have a Maximized group, which causes problem in RestoreProgMan '----------------- ' Reset properties '----------------- x.Label1.LinkTimeout = 50 x.Label1.LinkMode = 0 Screen.MousePointer = 0 End Sub