I am trying to write a program in C/C++ for the win32 environment that will change a certain printer to the default printer. Any help I could get would be great!
Printable View
I am trying to write a program in C/C++ for the win32 environment that will change a certain printer to the default printer. Any help I could get would be great!
Hey Tom Salomone, Todd here ;) Checking out documentation on SetPrinter() API and here's what I have. You want a PRINTER_INFO_2 structure, to call to SetPrinter.
SetPrinter(hPrinter,2,(PRINTER_INFO_2*)&pInfo,0);
For your pInfo PRINTER_INFO_2 structure, Set the Attributes field to contain PRINTER_ATTRIBUTE_DEFAULT.
I guess a call to GetPrinter would be used to fill the PRINTER_INFO_2 structure, then just modify the Attributes (pInfo.Attributes |= PRINTER_ATTRIBUTE_DEFAULT);