[This is preliminary documentation and subject to change.]
The DeletePrinterKey function deletes a specified key and all its subkeys for a specified printer.
DWORD DeletePrinterKey(
HANDLE hPrinter, // handle to printer object
LPCTSTR pKeyName // name of the registry key to delete
);
If pKeyName is an empty string (""), DeletePrinterKey deletes all keys below the top-level key for the printer. If pKeyName is NULL, DeletePrinterKey returns ERROR_INVALID_PARAMETER.
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a Win32 error value.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winspool.h.
Import Library: Use winspool.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, DeletePrinterDataEx, EnumPrinterDataEx, EnumPrinterKey, GetPrinterDataEx, OpenPrinter, SetPrinterDataEx