以下是引用有点甜在2014-2-25 21:13:00的发言:
没有win7测试,大致如此,你试试
全局代码这样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()
If Fib.Name = sVerb Then
Fib.DoIt()
Return True
End If
Next
Return False
End Function
调用这样
LockApp(true, "C:\Windows\notepad.exe")
你还需要引用一个dll
。
我是新手啊,对于什么调用,什么dll,都是一头雾水啊,有没有像帮助文件一样的范例步骤详解啊