Link to home
Start Free TrialLog in
Avatar of santamaria
santamaria

asked on

C++ Language question

Could someone give me an example using the following API:

OpenPrinter();
FindFirstPrinterChangeNotification();
WaitForSingleObjectEx()
FindNextPrinterChangeNotification();

I'm using MS Visual C++ on Windows NT 4.0
I am trying to log the print jobs that are sent to the printer on an NT 4.0 PrintServer, together with the username and number of pages. I'm able to get a printer handle, then a handle to the notification object. I then use the WaitForObjectEx() function to wait for the change notification (PRINTER_CHANGE_ADD_JOB. The wait functions then returns successfully. When I use the FindNextPrinterChangeNotification() It returns a value of 1 yet the information structure contains no information.I'm declaring a PRINTER_NOTIFY_INFO and I then use a pointer to this structure to pass it to the FindNextPrinterChangeNotification().

Thanks.
Avatar of santamaria
santamaria

ASKER

Edited text of question
I'm writing an example right now. Will post when done.
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial