从windows启动菜单中删除exe快速启动

编程入门 行业动态 更新时间:2024-10-28 06:34:32
本文介绍了从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快速启动

本文发布于:2023-10-22 09:11:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517084.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:快速启动   菜单中   windows   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!