C#将程序锁定到Windows7任务栏
2012-07-16 13:03
615 查看
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Shell32; using System.IO; namespace TestWin7Taskbar { class Win7Taskbar { public static bool LockApp(bool isLock, string appPath) { Shell shell = new Shell(); Folder folder = shell.NameSpace(Path.GetDirectoryName(appPath)); FolderItem app = folder.ParseName(Path.GetFileName(appPath)); string sVerb = isLock ? "锁定到任务栏(&K)" : "从任务栏脱离(&K)"; foreach (FolderItemVerb Fib in app.Verbs()) { if (Fib.Name == sVerb) { Fib.DoIt(); return true; } } return false; } } }
Win7Taskbar.LockApp(true, appPath)
Win7Taskbar.LockApp(falase, appPath
相关文章推荐
- windows7 旗舰版 不能将程序锁定到任务栏
- 解决windows7无法锁定任务栏程序及去除快捷方式箭头问题
- 找回Windows7的“将此程序锁定到任务栏”功能(Pin to Taskbar / Pin to Start Menu)
- C#实现将程序锁定到Win7任务栏的方法
- windows7不能将程序快捷方式附加到任务栏,没有"将此程序锁定到任务栏"项的解决办法
- 改善C#程序的建议8:避免锁定不恰当的同步对象
- C#程序中控制Windows的任务栏
- 改善C#程序的建议8:避免锁定不恰当的同步对象
- 用 C# 编写一个停放在任务栏上的图标程序
- win7如何把一个程序锁定到任务栏
- 编写高质量代码:改善c#程序的157个建议之“避免锁定不恰当的同步对象”
- C#WinForm程序不不在任务栏显示的处理方法
- C# 控制台程序 不显示在任务栏 只在进程中显示
- winapi 锁定程序到任务栏 c++
- 在C#中怎么让应用程序在任务栏上显示该程序的图标?
- 用 C# 编写一个停放在任务栏上的图标程序
- C#程序中控制Windows的任务栏
- 将程序锁定到任务栏
- c#中怎么让程序在屏幕上显示的时候任务栏中不显示?
- 改善C#程序的建议8:避免锁定不恰当的同步对象