本文主要是介绍用VB创建开始菜单快捷方式(无需其他DLL),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Option ExplicitPrivate Sub Command1_Click()
CreateProgManGroup Me, "测试", "test.grp"
CreateProgManItem Me, "d:\ghost.exe", "Ghost"
CreateProgManItem Me, "d:\setupQQ.exe", "QQ"
End Sub
Sub CreateProgManGroup(X As Form, GroupName$, GroupPath$)
Dim i As Integer
X.Label1.LinkTopic = "ProgMan|Progman"
X.Label1.LinkMode = 2
Rem 空循环使DDE有时间执行
For i = 1 To 10
DoEvents
Next
X.Label1.LinkTimeout = 100
Rem LinkExecute 是在DDE通道中传送这样的命令
'──建立一个名为GroupName $的程序组。
X.Label1.LinkExecute "[ CreateGroup (" + GroupName$ + Chr$(44) + GroupPath$ + ") ]"
X.Label1.LinkTimeout = 50 '恢复Label1 的属性值
X.Label1.LinkMode = 0
End Sub
Sub CreateProgManItem(X As Form, CmdLine$, IconTitle$)
Dim i As Integer
X.Label1.LinkTopic = "ProgMan|Progman"
X.Label1.LinkMode = 2
For i = 1 To 10
DoEvents
Next
X.Label1.LinkTimeout = 100
X.Label1.LinkExecute "[AddItem(" + CmdLine$ + Chr$(44) + IconTitle$ + Chr$(44) + ", ,) ]"
X.Label1.LinkTimeout = 50 '恢复Label1 的属性值
X.Label1.LinkMode = 0
Screen.MousePointer = 0
End Sub
这篇关于用VB创建开始菜单快捷方式(无需其他DLL)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!