printing - How to show printer preferences window having "Apply" button to save changes permanently in c#? -
i able show printer preferences window using code below:
string printername = cmbslideprinter.selecteditem.tostring(); bool islandscape = cmbslideprintorientation.selectedindex == 0; //print method 3 using (var printqueue = new printqueue(new printserver(), printername)) { var printdialog = new printdialog(); printdialog.printqueue = printqueue; printdialog.printticket.pageorientation = islandscape ? pageorientation.landscape : pageorientation.portrait; //set printer settings printticketconverter ptc = new printticketconverter(printqueue.fullname, printqueue.clientprintschemaversion); intptr mainwindowptr = new windowinterophelper(this).handle; byte[] mydevmode = ptc.convertprinttickettodevmode(printdialog.printticket, basedevmodetype.userdefault); gchandle pinneddevmode = gchandle.alloc(mydevmode, gchandletype.pinned); intptr pdevmode = pinneddevmode.addrofpinnedobject(); int result = documentproperties(mainwindowptr, intptr.zero, printqueue.fullname, pdevmode, pdevmode, 14); if (result == 1) //changes saved { printdialog.printticket = ptc.convertdevmodetoprintticket(mydevmode); } pinneddevmode.free(); }
the printer preferences window shows has "ok" button , no "apply" button. when "ok" clicked changes not saved returned application.
but if printer preferences window shown via windows "devices , printers" folder has "apply" button , changes saved permanently on clicking "apply" or "ok" button.
what want save changes permanently latter window does. how open window permanent save functionality or save settings manually through c# code?
Comments
Post a Comment