Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get the images for printers in .NET? [duplicate]

If I open up "Devices and Printers" on my machine (Windows 7), I see something like this for the printers:

Printers with Images

Is there a way to get these images from the OS in my WPF application? I would like to list printers much like this, but right now I only have the text for the printers (not the images).

like image 283
Vaccano Avatar asked Nov 11 '22 17:11

Vaccano


1 Answers

You need to call SetupDiLoadDeviceIcon. You'll have to read up on MSDN and play with p-Invoke a bit to get this working from the managed side...

The info comes from registry, but you shouldn't look for it yourself. See Providing Vendor Icons for the Shell and AutoPlay.

like image 152
Remus Rusanu Avatar answered Nov 15 '22 06:11

Remus Rusanu