Hola estoy usando FindFirstPrinterChangeNotification para informarme sobre cambios de la impresora... Uso Win2k.SP4 + Delphi 6
Mi duda es sobre como saber que vanderas (opciones de monitoreo) del campo bandera 'fdwFlags' estan activas.
Se supone que soporta varias condiciones de monitorio, por ejemplo PRINTER_CHANGE_ADD_JOB PRINTER_CHANGE_SET_JOB PRINTER_CHANGE_DELETE_JOB PRINTER_CHANGE_WRITE_JOB.
Código:
HANDLE FindFirstPrinterChangeNotification(
HANDLE hPrinter, // handle to printer or print server to monitor for changes
DWORD fdwFlags, // flags that specify the conditions to monitor
DWORD fdwOptions, // reserved, must be zero
LPVOID pPrinterNotifyOptions // pointer to structure specifying printer information
to monitor
);
Les detallo los pasos
defino Optio como DWord; y luego seteo
Options:=PRINTER_CHANGE_ADD_JOB+PRINTER_CHANGE_SET_JOB;
(esto al parecer anda, por como se comporta el monitoreo)
y luego uso Options como parametro de la funcion FindFirstPrinterChangeNotification.
el problema viene cuando llamo a FindNextPrinterChangeNotification
Código:
BOOL FindNextPrinterChangeNotification(
HANDLE hChange, // handle to change notification object of interest
PDWORD pdwChange, // pointer to a value that indicates the condition that changed
LPVOID pPrinterNotifyOptions, // pointer to a structure that specifies a refresh flag
LPVOID *ppPrinterNotifyInfo // pointer to a pointer that receives printer information buffer
);
en pdwChange devuelve lo que sucedio con la impresora, supuestamente son valores de las constantes PRINTER_CHANGE_ADD_JOB PRINTER_CHANGE_SET_JOB, pero no se como saber cual de las dos fue la activa.
con un if pdwChange=PRINTER_CHANGE_ADD_JOB , en algunas combinaciones pasa de largo.
No se si me explique bien, pero en si quiero saber como preguntar por una vandera activa en una variable del api32 del tipo DWORD.