阅读:1577回复:0
■■■■打印机驱动中 如何截取打印文档的详细信息
OEMStartDoc(
SURFOBJ *pso, PWSTR pwszDocName, DWORD dwJobId) { TERSE(UNITEXT("OEMStartDoc() entry.\r\n")); PDEVOBJ pdevobj = (PDEVOBJ)pso->dhpdev; POEMPDEV pOemPDEV = (POEMPDEV)pdevobj->pdevOEM; //记录打印机详细信息 DWORD pcbNeeded=0; DWORD pcReturned=0; JOB_INFO_2 * pJobInfo=NULL; SYSTEMTIME st; pJobInfo = (JOB_INFO_2 *) LocalAlloc(LPTR, pcbNeeded); GetJob((HANDLE)pdevobj->hPrinter,dwJobId,2,(LPBYTE)pJobInfo,pcbNeeded,(LPDWORD)&pcReturned); //↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑这样写是否能得到正确的信息 /////如果能 那如何记录到文件如xml文件 txt文件 等 // turn around to call Unidrv return (((PFN_DrvStartDoc)(pOemPDEV->pfnUnidrv[UD_DrvStartDoc])) ( pso, pwszDocName, dwJobId )); } |
|