2007-10-25 22:42:10 Kenny

如何在開始功能表的程式集中增Group

來源:不詳,cww重新整理

這是使用DDE的方式來做,另一個方法是在Registry中得知程式集所在的目錄,而後
在該目錄上新增一個目錄(使用MkDir),但如何在該在該目錄內Create Shell Link呢?唉,
只好再使用以下的方式:(假設 開始 程式集 中有一CWW)

Private Declare Function fCreateShellLink Lib "vb5stkit.dll" _
    (ByVal Forder As String, ByVal ShortCutName As String, _
     ByVal ExePath As String, ByVal Params As String) As Long


Private Sub Command1_Click()
 Dim ret As Long
 '放在程式集功能表中CWW目錄下
 ret = fCreateShellLink(".\CWW", "MyName", "c:\tools\spe3\pe2.exe", "")
End Sub

'Created by DDE
'以下程式需一個Text1, List1, Command1當Form Load時會將待Create的Shell Link
'放在ListBox中,這請自行修改;而Text1.Text是我們想在程式集中Create的Folder
'名稱(Group名稱)

Private Sub Command1_Click()
    Dim x As Long
    On Error Resume Next
    MousePointer = 11

    Text1.LinkTopic = "Progman|progman"
    Text1.LinkMode = 2
    Text1.LinkExecute "[CreateGroup(" + Text1.Text + ")]"

    For x = 0 To List1.ListCount - 1
        Text1.LinkExecute "[AddItem(" + List1.List(x) + ")]"
    Next x
    Text1.LinkExecute "[ShowGroup(" + Text1.Text + ", 7)]"
    Text1.LinkMode = 0
    MousePointer = 0
End Sub

Private Sub Form_Load()
List1.AddItem "c:\command.com"
List1.AddItem "c:\tools\axclear.exe"
End Sub