I am using a PDF control suite, that creates a print queue automatically on start up, but occasionally, if the app is terminated abnormally, the queue is not removed, so on the next start up, it creates a duplicate.
I can check for the print queues to find it, using the Printers list, but I can't see how to delete a specific queue?
Uses Winspool, printers;
GetCurrentPrinterHandle
Retrieves the handle of the current printer @Returns an API printer handle for the current printer @Desc Uses WinSpool.OpenPrinter to get a printer handle. The caller takes ownership of the handle and must call ClosePrinter on it once the handle is no longer needed. Failing to do that creates a serious resource leak!
Requires Printers and WinSpool in the Uses clause. @Raises EWin32Error if the OpenPrinter call fails.