(已解决)如何使用AU3在win7的任务栏里面创建软件的快捷图标
本帖最后由 the2008 于 2014-11-17 22:13 编辑如何使用AU3在win7的任务栏里面创建软件(比如office2010)的快速启动图标?
晚上用谷歌搜索了一下,终于让我找到了,十分膜拜
这是代码引用的地址:
http://www.autoitscript.com/forum/topic/116641-how-can-i-create-any-shortcut-at-the-quicklaunch-for-windows-7/#include <WinAPI.au3>
#include <Constants.au3>
_PinTaskbar(@WindowsDir & '\notepad.exe')
Func _PinTaskbar($File, $Pin = True)
If @OSBuild < 7600Then Return SetError(1) ; Windows 7 only
If Not FileExists($File) Then Return SetError(2)
local $sFolder = StringRegExpReplace($File, "(^.*\\)(.*)", "\1")
local $sFile = StringRegExpReplace($File, "^.*\\", "")
local $oShell = ObjCreate("Shell.Application")
local $oFolder = $oShell.NameSpace($sFolder)
local $oFolderItem = $oFolder.ParseName($sFile)
local $oFolderItemVerbs = $oFolderItem.Verbs
local $hInstance = _WinAPI_LoadLibraryEx("shell32.dll", $LOAD_LIBRARY_AS_DATAFILE)
local $DoVerb = ''
If $hInstance Then
IF $Pin = 1 Then
local $DoVerb = _WinAPI_LoadString($hInstance, 5386)
Else
local $DoVerb = _WinAPI_LoadString($hInstance, 5387)
EndIf
_WinAPI_FreeLibrary($hInstance)
EndIf
IF $DoVerb = '' Then Return SetError(3) ; $DoVerb string couldn't received
For $i = 0 To $oFolderItemVerbs.Count - 1
If $oFolderItemVerbs.Item($i).Name = $DoVerb Then
$oFolderItemVerbs.Item($i).DoIt
Return
EndIf
Next
Return SetError(4) ; $DoVerb string not in menu
EndFunc 我也很想了解这个。 那如何解除任务栏上的快捷方式呢? 先看看学习一下! 不错,学习了。 不错,学习了。 不知道WIN8.1和WIN10能不能用
页:
[1]