我win8测试,全局代码要这样改
Public Function LockApp(isLock As Boolean, appPath As String) As Boolean
Dim shell As New Shell32.Shell()
Dim folder As Shell32.Folder = shell.[NameSpace](System.IO.Path.GetDirectoryName(appPath))
Dim app As Shell32.FolderItem = folder.ParseName(System.IO.Path.GetFileName(appPath))
Dim sVerb As String = iif(isLock, "固定到任务栏(&K)", "从任务栏取消固定(&K)")
For Each Fib As Shell32.FolderItemVerb In app.Verbs()
msgbox(fib.name)
If Fib.Name = sVerb Then
Fib.DoIt()
Return True
End If
Next
Return False
End Function