从windows启动菜单中删除exe快速启动 [英] Removing exe from windows startmenu quick launch

查看:122
本文介绍了从windows启动菜单中删除exe快速启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于工作,我们有两个快捷方式安装到开始菜单,两个指向同一个exe(但第二个具有不同的命令行参数)。

For work we have two shortcuts that get installed to the start menu with both of them pointing to the same exe (but the second with different command line arguments).

有时候窗口会选择第二个快捷方式显示在开始菜单的热门程序列表中,这是不好的,因为它会导致应用程序的完全更新。

Some times windows will pick the second shortcut to display in the start menu hot program list which is bad because it causes a full update of the application.

有没有办法告诉windows不要在开始菜单列表中显示这个快捷方式?

Is there a way to tell windows not to show that shortcut in the start menu list?

推荐答案

是的,事实上Raymond Chen 刚刚写了这篇文章

Yes, in fact Raymond Chen just wrote about this:


您可以设置 System.AppUserModel.ExcludeFromShowInNewInstall 属性 VARIANT_TRUE 来告诉开始菜单,我不是程序的主要入口点;我是辅助快捷方式,如帮助文件。

You can set the System.App­User­Model.Exclude­From­Show­In­New­Install property to VARIANT_TRUE to tell the Start menu, "I am not the primary entry point for the program; I'm a secondary shortcut, like a help file."

示例代码( CCoInitialize class ):

Sample code (CCoInitialize class):

#include <windows.h>
#include <tchar.h>
#include <shlobj.h>
#include <atlbase.h>

// class 3CCoInitialize incorporated here by reference

int __cdecl _tmain(int argc, TCHAR **argv)
{
 // error checking elided for expository purposes
 CCoInitialize init;
 CComPtr<IShellLink> spsl;
 spsl.CoCreateInstance(CLSID_ShellLink);
 spsl->SetPath(TEXT("C:\\Program Files\\LitWare\\LWUpdate.exe"));
 PROPVARIANT pvar;
 pvar.vt = VT_BOOL;
 pvar.boolVal = VARIANT_TRUE;
 CComQIPtr<IPropertyStore>(spsl)->SetValue(PKEY_AppUserModel_ExcludeFromShowInNewInstall, pvar);
 CComQIPtr<IPersistFile>(spsl)->Save(L"LitWare Update.lnk", TRUE);
 return 0;
}

这篇关于从windows启动菜单中删除exe快速启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆