Windows 7 - 任务栏 - 固定或取消固定程序链接

Yig*_* Wu 8 winapi windows-7

在标题中,是否有任何Win32 API可以做到这一点?

Kev*_*ose 16

不要这样做.

我99%肯定没有官方API,原因与没有以编程方式访问旧的开始菜单的引脚列表完全相同.

简而言之,大多数用户不希望程序将垃圾放入他们的收藏夹,快速启动,任务栏等等,因此Windows不支持您这样做.

  • 凯文的答案是正确的:).只需抵抗客户的压力. (9认同)

Cia*_*tic 7

我正在尝试实现一个VirtuaWin(开源虚拟桌面软件)插件,它允许我将不同的按钮固定到不同的虚拟桌面.使用此完全有效的理由.

找到了固定它的方法:

以下代码片段取自Chromium shortcut.cc文件,几乎没有变化,另请参阅MSDN上ShellExecute函数

bool TaskbarPinShortcutLink(const wchar_t* shortcut) {
  int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarpin", shortcut,
      NULL, NULL, 0));
  return result > 32;
}

bool TaskbarUnpinShortcutLink(const wchar_t* shortcut) {
  int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin",
      shortcut, NULL, NULL, 0));
  return result > 32;
}    
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Run Code Online (Sandbox Code Playgroud)

如果你知道快捷方式,看起来很简单.对我而言,虽然这还不够,但我还需要迭代现有的按钮并取消固定并在不同的桌面上重新制作它们.

  • 这有效,但请注意,Microsoft 在 Windows 10 中删除了对它的支持。并且在 7 之前没有“固定到任务栏”功能。因此它仅适用于 7 和 8,我已经通过直接测试确认了这一点。 (2认同)

tsu*_*man 0

该文件夹包含固定应用程序的快捷方式

C:\Users\您的用户名\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar