windows 如何以编程方式操作“开始”菜单的“最近使用的程序”列表?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/739839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can one manipulate the Start menu's "Recently Used Programs" list programmatically?
提问by Tarnay Kálmán
I'm looking for a way to make programs appear (frequently) used, so that they would appear in the Start menu's "Recently Used Programs" (after a zero touch install).
我正在寻找一种使程序出现(经常)使用的方法,以便它们出现在“开始”菜单的“最近使用的程序”中(在零触摸安装之后)。
I'm trying to figure out how Windows stores information related to program usage frequency.
我试图弄清楚 Windows 如何存储与程序使用频率相关的信息。
The only (maybe) related things I can see being changed when I run a program from the Start Menu, are some (seemingly undocumented) BagMRU registry keys which have no meaning to me.
当我从“开始”菜单运行程序时,我能看到的唯一(可能)相关的东西是一些(似乎没有记录的)BagMRU 注册表项,它们对我没有意义。
I did found a wayto get programs pinned, but that's not what I'm looking for here.
Update: please see the comments for explanation why I would like to do this...
更新:请参阅评论以解释我为什么要这样做......
Update2: I'm making progress... Now I know where they keys are stored and I know that the keys are ROT13"encrypted". And the second 4 bytes of the values are the counter.. http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you're-joking/
Update2:我正在取得进展......现在我知道它们的密钥存储在哪里,并且我知道这些密钥是ROT13“加密的”。值的后 4 个字节是计数器.. http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you're-joking/
This ROT13(wikipedia)encryption thing is funny. Well, of course there is a reason. They don't want you to be able to find it by simple search.
这个ROT13(维基百科)加密的东西很有趣。嗯,当然是有原因的。他们不希望您通过简单的搜索就能找到它。
Lol, and in windows 7 they are using Vigenère crypto!much better :D
采纳答案by Tarnay Kálmán
I found what I was looking for here:
我在这里找到了我要找的东西:
http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you're-joking/
http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you're-joking/
回答by paxdiablo
At the risk of downvotes, this is not something you should be doing. The "Recently Used Programs" belongs to the owner of the computer, not your program.
冒着被否决的风险,这不是您应该做的事情。“最近使用的程序”属于计算机的所有者,而不是您的程序。
If your program is as useful as you think it is, it will automagically show up there.
如果您的程序和您认为的一样有用,它会自动显示在那里。
Raymond Chen has done quite a few articles as to why this sort of thing is a bad idea.
Raymond Chen 已经写了很多关于为什么这种事情是个坏主意的文章。
This rates among all those other bad ideas such as:
这在所有其他坏主意中占了比例,例如:
- how can I force my program to be the handler for certain file types?
- how can I keep my program always on top.
- how can I annoy my users by making decisions for them when they previously had the power to make their own decisions as to how their software was configured? :-)
- 如何强制我的程序成为某些文件类型的处理程序?
- 我怎样才能让我的程序始终处于领先地位。
- 当我的用户以前有权自行决定其软件的配置方式时,我如何通过为他们做出决定来惹恼他们?:-)
Update:
更新:
A couple of things you may want to try.
您可能想尝试一些事情。
- Copy a program (explorer.exe) to axolotl.exe and run it enough times to get it on the list. Then search the registry for it (assuming there's not another axolotl.exe somewhere on your disk).Be aware that some strings are stored as Unicode so it might not be a simple search. It also wouldn't surprise me if MS encoded them some way to make this more difficult.
- Microsoft's sysinternals have a tool that can monitor the registry (regmon, look here, you could run that while you run a program a few times to see what gets updated when it's added to the list.
- 将程序 (explorer.exe) 复制到 axolotl.exe 并运行足够多的时间使其出现在列表中。然后在注册表中搜索它(假设您的磁盘上没有其他 axolotl.exe)。请注意,某些字符串存储为 Unicode,因此它可能不是一个简单的搜索。如果 MS 以某种方式对它们进行编码以使其更加困难,我也不会感到惊讶。
- Microsoft 的 sysinternals 有一个可以监视注册表的工具(regmon,看这里,您可以在运行程序几次的同时运行它,以查看将其添加到列表中时更新的内容。
回答by Simon Broadhead
If this is possible, I do recommend against it. It is, as you say, undocumented behaviour and circumvents the intended usage of the frequently used programs list. What's wrong with a desktop icon and quick launch shortcut?
如果这是可能的,我建议不要这样做。正如您所说,这是未记录的行为并规避了常用程序列表的预期用途。桌面图标和快速启动快捷方式有什么问题?
回答by Simon Broadhead
Use Win32 Shell COM interfaces
It has been explained for decades, like for all undocumented features, on Google Groups (Win32), same method than on W95..
使用 Win32 Shell COM 接口
它已经解释了几十年,就像所有未记录的功能一样,在 Google Groups (Win32) 上,与 W95 上的方法相同..