高级任务栏技术:Jump Lists与进度条的使用
1. 注销文件扩展名
当应用程序关闭时,会调用 frmMain_FormClosing 事件处理程序。以下是相关代码:
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
// Check for a primary application instance.
if (IsPrimary)
{
// Clear the Recent common category so it doesn’t appear when
// the application is pinned.
TheJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Neither;
TheJumpList.Refresh();
// Unregister the .TXT file extension if this is the primary instance.
RegisterFileExtension(“.txt”, true);
}
}
操作步骤如下:
1. 检查是否为应用程序的主实例。
2. 如果是主实例,清除“最近”常用类别,避免应用程序固定到任务栏时显示该类别。
3. 调用 RegisterFileExt
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



