掌握运行的应用程序关联的图标 [英] Getting the icon associated with a running application

查看:95
本文介绍了掌握运行的应用程序关联的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有开放式应用程序的窗口句柄,我能够使用GetWindowText函数功能来检索应用程序的标题栏中的文本。我想借此一步越走越检索与相同的应用程序关联的图标。



我怎么会去这样做?我经历了什么,我认为将是相关的Win32 API的部分看,但没有我跳了出来。



任何指针将不胜感激。


提前

谢谢!


解决方案

 图标ICO =图标。 ExtractAssociatedIcon(theProcess.MainModule.FileName); 

从TheSoftwareJedi



最初,这似乎是的 http://stackoverflow.com/questions/203456/how-can-i-get-the-icon-from-the-executable-file-only-having-an-instance -of-其但是这一次似乎把重点主要是如何从它的自身内得到它,而你可能会问如何使用程序从正在运行的进程分离得到的图标。




Having the window handle for an open application, I'm able to use the GetWindowText function to retrieve the text from the title bar of the app. I would like to take this a step farther and retrieve the icon associated with the same app.

How might I go about doing this? I looked through what I thought would be the relevant Win32 API sections, but nothing jumped out at me.

Any pointers would be appreciated.

Thanks in advance!

解决方案

Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);

From TheSoftwareJedi

Initially this appears to be an exact duplicate of http://stackoverflow.com/questions/203456/how-can-i-get-the-icon-from-the-executable-file-only-having-an-instance-of-its but that one seems to focus largely on how to get it from within it's own self, whereas you may be asking how to get the icon using a program separate from the running process.

这篇关于掌握运行的应用程序关联的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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