如何获得打印机的相关图标? [英] How Do I Get a Printer's Associated Icon?

查看:73
本文介绍了如何获得打印机的相关图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何获取与已安装的打印机或设备关联的图标.例如,在Windows 7上,如果转到设备和打印机"对话框,将看到打印机,鼠标,HDD,显示器等的列表. 分配给他们的图标.我该如何使用C#检索这些图标.如果需要,可以使用P/Invoke.

I am trying to figure out how to get the icon that is associated with an installed printer or device. For example, on Windows 7 if you goto the Devices and Printers dialog you will see a list of printers, mouses, HDDs, monitors, etc. All of these have icons assigned to them. How do I go about retrieving those icons using C#. P/Invoke is fine if I need to.

推荐答案

欢迎来到MSDN论坛.

Welcome to the MSDN forum.

许多文件都嵌入了图标,这些图标提供了相关文件类型的直观表示.例如,Microsoft Word文档包含一个标识它们的图标 作为Word文档.在列表控件或表控件中显示文件时,可能需要在每个文件名旁边显示代表文件类型的图标.您可以使用 方法.

Many files have embedded icons that provide a visual representation of the associated file type. For example, Microsoft Word documents contain an icon that identifies them as Word documents. When displaying files in a list control or table control, you may want to display the icon representing the file type next to each file name. You can do this easily by using the ExtractAssociatedIcon method.

http://msdn.microsoft.com/en-us/library/ms404308.aspx

此外,您可以阅读以下主题:

Moreover, you can read this thread:

http://stackoverflow.com/questions/1063874/检索当前用户打印机的图标

已实现Win32  SHGetFileInfo来获取它.

Which has implement Win32 SHGetFileInfo to get it.

希望这对您有所帮助.


这篇关于如何获得打印机的相关图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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