Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use EnumJobs function - HELP!
Message
De
16/11/2003 07:02:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to use EnumJobs function - HELP!
Divers
Thread ID:
00850408
Message ID:
00850408
Vues:
71
Hi All,

I want to be able to view on a VFP form all print jobs that were created on a particular printer so I can also save it into a table.

I figured out how to use OpenPrinter, ClosePrinter, and EnumJobs API functions but cant get pass deciphering the contents of the pJob pointer parameter of EnumJobs bec of the DWORD, STRUCTs! Man, that's way over me...


BOOL EnumJobs(
HANDLE hPrinter, // handle to printer object
DWORD FirstJob, // location of first job in print queue to // enumerate
DWORD NoJobs, // number of jobs to enumerate
DWORD Level, // structure level
LPBYTE pJob, // pointer to structure array
DWORD cbBuf, // size of array, in bytes
LPDWORD pcbNeeded, // addr. of variable with no. of bytes copied
// (or required)
LPDWORD pcReturned // addr. of variable with no. of job info.
// structures copied
);

WHERE pJob is
"Pointer to an array of either JOB_INFO_1 or JOB_INFO_2 structures."

typedef struct _JOB_INFO_1 { // ji1
DWORD JobId;
LPTSTR pPrinterName;
LPTSTR pMachineName;
LPTSTR pUserName;
LPTSTR pDocument;
LPTSTR pDatatype;
LPTSTR pStatus;
DWORD Status;
DWORD Priority;
DWORD Position;
DWORD TotalPages;
DWORD PagesPrinted;
SYSTEMTIME Submitted;
} JOB_INFO_1;



I was able to get pJob into a character variable but it was full of all those unprintable characters although I can see the pPrintName, pMachineName, pUserName, pDocument contents in that variable.

HELP!

TIA
Dennis
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform