Hi.
I want to know the paper size and resolution selected by user for the
print job from StartDocPort function.
this is a StartDocPort function prototype:
BOOL WINAPI MyStartDocPort(
HANDLE hPort,
LPWSTR pPrinterName,
DWORD JobId,
DWORD Level,
LPBYTE pDocInfo)
due to it i have the printer, the port and the JobId
I have used it:
// obtain the DEVMODE struct witch have dmPaperLength and dmPaperWidth
fileds.
HANDLE hPrinter; // printer handle
JOB_INFO_2 JobInfo; // JobInfo2 Structure
DWORD dwNeeded; // bytes needed, if GetJob fails
// get printer handle
if (OpenPrinter(pPrinterName, &hPrinter, NULL))
{
// get JOB_INFO_2 structure.
if (GetJob(hPrinter, JobId, 2, (PBYTE)&JobInfo,
sizeof(JOB_INFO_2),&dwNeeded))
{
// set de DEVMODE struct.
CopyMemory(&pPort->DevMode, (JobInfo.pDevMode), sizeof(DEVMODE));
}
else
{
LeaveCritSection();
return FALSE;
}
}
but GetJob Call fails and return FALSE.
Any Ideas?
thanks in advance.
tolemaC / eleriumcore & unknownproductions
xxxxx@ono.com