C language function:GetPrinterDataEx sample codesSearch sample code in the internet.It is the result.
TITLE : Print Spooler API Functions (Windows)
TITLE : delphi - Save Printer Setup Parameters - Stack Overflow
The GetPrinterDataEx() API function Jeroen mentioned won't work, either, as it requires you to know ahead of time the name of the registry key that was used to store information via the SetPrinterDataEx() procedure, and that may or may not have been used by the printer driver. If it was used, you'd have to manually look at the registry to see where the driver publisher decided to store the info; I'd suspect that varies between printer manufacturers as well........