determine whether a driver is a print driver or a fax driver
-
Is there a way to determine whether an installed print driver (as shown in PrintDialog) is for a printer or a fax? PrinterSettings doesn't seem to provide that kind of information. cobra2005
Okay, not sure on this, but give it a shot. (I don't have a fax hooked up to any printer....) Put the following in a Console Application and run it to see if you get what you want. If a "printer" is fax capable, then hopefully you will see it in the
CapabilityDescriptions
property. You need to add a reference to the System.Management.dll in your project.// Create a management class to get the printers.
ManagementClass c = new ManagementClass( "Win32_Printer" );// Get the information for all the printers.
ManagementObjectCollection moc = c.GetInstances();// Iterate over the objects.
foreach( ManagementObject mo in moc )
{
string name = ( string ) mo.Properties[ "Caption" ].Value;
string[] desc = ( string[] ) mo.Properties[ "CapabilityDescriptions" ].Value;
Console.WriteLine( "{0}", name );
foreach( string s in desc )
{
Console.WriteLine( "\t{0}", s );
}
Console.WriteLine();
}If you don't see "Fax," or something like that, then iterate over all the properties of the
ManagementObject
and see if you can find something in there. Hope it helps. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty -
Okay, not sure on this, but give it a shot. (I don't have a fax hooked up to any printer....) Put the following in a Console Application and run it to see if you get what you want. If a "printer" is fax capable, then hopefully you will see it in the
CapabilityDescriptions
property. You need to add a reference to the System.Management.dll in your project.// Create a management class to get the printers.
ManagementClass c = new ManagementClass( "Win32_Printer" );// Get the information for all the printers.
ManagementObjectCollection moc = c.GetInstances();// Iterate over the objects.
foreach( ManagementObject mo in moc )
{
string name = ( string ) mo.Properties[ "Caption" ].Value;
string[] desc = ( string[] ) mo.Properties[ "CapabilityDescriptions" ].Value;
Console.WriteLine( "{0}", name );
foreach( string s in desc )
{
Console.WriteLine( "\t{0}", s );
}
Console.WriteLine();
}If you don't see "Fax," or something like that, then iterate over all the properties of the
ManagementObject
and see if you can find something in there. Hope it helps. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty -
Okay, not sure on this, but give it a shot. (I don't have a fax hooked up to any printer....) Put the following in a Console Application and run it to see if you get what you want. If a "printer" is fax capable, then hopefully you will see it in the
CapabilityDescriptions
property. You need to add a reference to the System.Management.dll in your project.// Create a management class to get the printers.
ManagementClass c = new ManagementClass( "Win32_Printer" );// Get the information for all the printers.
ManagementObjectCollection moc = c.GetInstances();// Iterate over the objects.
foreach( ManagementObject mo in moc )
{
string name = ( string ) mo.Properties[ "Caption" ].Value;
string[] desc = ( string[] ) mo.Properties[ "CapabilityDescriptions" ].Value;
Console.WriteLine( "{0}", name );
foreach( string s in desc )
{
Console.WriteLine( "\t{0}", s );
}
Console.WriteLine();
}If you don't see "Fax," or something like that, then iterate over all the properties of the
ManagementObject
and see if you can find something in there. Hope it helps. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertaintyThanks Curtis. I need something more "robust". though. There is no capability listed for a fax driver and I can't use the driver/printer name because of localization issues (the app should be designed to work in other countries, as well). Any other ideas? I've also tried Win32 API EnumPrinters with no luck. cobra2005