Available in LEADTOOLS Document and Medical Imaging toolkits.
L_PrnIsPrinterLocked
L_PrnLockPrinter
L_PrnUnlockPrinter