如何获取开始菜单窗口中的项目列表8.1 C# [英] How to get the list of items in the start menu windows 8.1 C#

查看:181
本文介绍了如何获取开始菜单窗口中的项目列表8.1 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我正在使用c#创建Windows应用程序,我正在自动化窗口。



我正在尝试获取Windows 8.1开始菜单中的项目列表。当我们只按下窗口键并且我们在开始菜单屏幕上获得了一些项目时,我只想获取这些项目,而不是我们按下开始菜单屏幕底部的DownArrow按钮时获得的项目。





点击此处了解更多详情



我的尝试:



Dear All,

I'm creating windows application using c#, where i'm automating windows.

I'm trying to get the list of items in the start menu in windows 8.1. When we press only window key and we get some items on the start menu screen, i want to fetch these items only but not those which we get when we press "DownArrow" button on the bottom of the start menu screen.


Click here for more details

What I have tried:

Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);





I尝试了上面的代码,但是当我们按下开始菜单屏幕底部的DownArrow按钮时,我得到了那些项目。



但我是当我们只按下窗口键时,我们会找到那些物品。



任何人都可以帮助我。





提前致谢。



I have tried above code but i'm getting those items which we get when we press "DownArrow" button on the bottom of the start menu screen.

But i'm looking for those items which we get when we press only window key.

Can anyone please help me.


Thanks in advance.

推荐答案

参见此文章: C#:获取开始菜单程序的路径(所有用户) - 编程(C#,C ++,JAVA,VB ,.NET等) - Neowin [ ^ ]

See this article: C#: Get path of Start Menu programs (All USERS) - Programming (C#, C++, JAVA, VB, .NET etc.) - Neowin[^]
class Program
{
	[DllImport("shell32.dll")]
	static extern bool SHGetSpecialFolderPath(IntPtr hwndOwner, [Out] StringBuilder lpszPath, int nFolder, bool fCreate);
	const int CSIDL_COMMON_STARTMENU = 0x16;  // \Windows\Start Menu\Programs

	static void Main(string[] args)
	{
		StringBuilder path = new StringBuilder(260);
		SHGetSpecialFolderPath(IntPtr.Zero, path, CSIDL_COMMON_STARTMENU, false);
		string s = path.ToString();
	}
}


这篇关于如何获取开始菜单窗口中的项目列表8.1 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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