使用StdUtils实现任务栏和开始菜单锁定解锁程序图标

Caption "InvokeShellVerb"
OutFile "InvokeShellVerb.exe"

!addincludedir "..\..\Include"

!include 'StdUtils.nsh'

RequestExecutionLevel user
ShowInstDetails show

Section "任务栏锁定"
 ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToTaskbar}
 StrCmp "$0" "ok" 0 +3
 MessageBox MB_TOPMOST "任务栏锁定成功!"
 Goto +2
 MessageBox MB_TOPMOST "任务栏锁定失败!"
SectionEnd

Section "任务栏解锁"
 ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}
 StrCmp "$0" "ok" 0 +3
 MessageBox MB_TOPMOST "任务栏解锁成功!"
 Goto +2
 MessageBox MB_TOPMOST "任务栏解锁失败!"
SectionEnd

Section "开始菜单锁定"
 ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToStart}
 StrCmp "$0" "ok" 0 +3
 MessageBox MB_TOPMOST "开始菜单锁定成功!"
 Goto +2
 MessageBox MB_TOPMOST "开始菜单锁定失败!"
SectionEnd

Section "开始菜单解锁"
 ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromStart}
 StrCmp "$0" "ok" 0 +3
 MessageBox MB_TOPMOST "开始菜单解锁成功!"
 Goto +2
 MessageBox MB_TOPMOST "开始菜单解锁失败!"
SectionEnd
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容