Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
NotificationMon.ƒ/Source/Printing.c
/* |
*/ |
#include <Printing.h> |
short GetPrinterID() |
{ |
THPrint tpr; |
short printerID; |
short err; |
tpr = NewHandle(sizeof(TPrint)); |
if(!tpr) return -1; |
PrOpen(); |
if(err = PrError()) |
{ |
Debugger(); |
} |
(void) PrValidate(tpr); /* initialize print rec */ |
/* get printer ID from high byte of wDev */ |
printerID = (**tpr).prStl.wDev >> 8; |
PrClose(); |
DisposHandle(tpr); |
return printerID; |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14