Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
TitleCreate program groups and items in program groups
DescriptionThis example shows how to create program groups and items in program groups in Visual Basic 6. The program uses DDE to send appropriate messages to ProgMan (the program manager).
Keywordsprogram group, group, folder, item
CategoriesWindows, Files and Directories
 
The program uses DDE to send appropriate messages to ProgMan (the program manager). The group appears as a folder in the Start Menu\Programs directory (C:\Windows\Start Menu\Programs in Windows 98).

To create a group, the program sends ProgMan the message of the form:

    [CreateGroup(MyGroup,mygroup.grp)]
 
' Create a new program group.
'   lbl     Label for sending DDE messages
'   gname   The group's name
'   fname   Group file name
Private Sub CreateGroup(lbl As Label, gname As String, _
    fname As String)
Dim i As Integer

    lbl.LinkTopic = "ProgMan|Progman"
    lbl.LinkMode = 2
    DoEvents
    lbl.LinkTimeout = 100

    ' Create the program group.
    lbl.LinkExecute "[CreateGroup(" & gname & _
        "," & fname & ")]"

    ' Restore lbl values.
    lbl.LinkTimeout = 50
    lbl.LinkMode = 0
End Sub
 
To create an item, the program sends ProgMan a message of the form:

    [AddItem(D:\Tmp\Ideas.txt,My New Item)]
 
' Create a new item in a group.
'   lbl     Label for sending DDE messages
'   gname   The group's name
'   cmd     Fully qualified command for item
'   iname   The item's name
Private Sub CreateItem(lbl As Label, gname As String, cmd _
    As String, iname As String, minimized As Boolean)
    lbl.LinkTopic = "ProgMan|Progman"
    lbl.LinkMode = 2
    DoEvents
    lbl.LinkTimeout = 100

    lbl.LinkExecute "[ShowGroup(" & gname & ", 1)]"

    If minimized Then
        lbl.LinkExecute "[AddItem(" & _
            cmd & "," & iname & ",,,,,,,1)]"
    Else
        lbl.LinkExecute "[AddItem(" & _
            cmd & "," & iname & ")]"
    End If

    ' Restore lbl values.
    lbl.LinkTimeout = 50
    lbl.LinkMode = 0
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated