Tester une variable de FindNextPrinterChangeNotification
cs_sena
Messages postés126Date d'inscriptionjeudi 9 janvier 2003StatutMembreDernière intervention15 février 2005
-
18 juin 2003 à 10:13
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019
-
18 juin 2003 à 10:23
chgObject = FindFirstPrinterChangeNotification( hPrinter, PRINTER_CHANGE_JOB, 0, NULL);
WaitForSingleObject(chgObject, INFINITE);
fcnreturn = FindNextPrinterChangeNotification(chgObject, &pdwChange, NULL, NULL);
if (fcnreturn) {
//Ici il faut que je travaille sur pdwchange
}
Dans la msdn en ligne, ils disent :
pdwChange
[out] Pointer to a variable whose bits are set to indicate the changes that occurred to cause the most recent notification. The bit flags that might be set correspond to those specified in the fdwFlags parameter of the FindFirstPrinterChangeNotification call. The system sets one or more of the following bit flags.
Mon problème est que je sais pas comment tester la valeur de pdwchange,
j'ai fait un switch-case mais ce ne fonctionne pas.
Comprends vraiment pas comment faut faire... :o(
Merci
Sena
PS : j'ai bien mis OpenPrinter et ClosePrinter à la bonne place.
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 18 juin 2003 à 10:23
en 1er faudra tester valeur de sortie de WaitForSingleObject.
Ensuite pour pdwChange, exemple:
if((pdwChange & PRINTER_CHANGE_TIMEOUT) == PRINTER_CHANGE_TIMEOUT) case machin truc.
Tu peux combiner les flags, suffit que combination soit coherente.
BruNews, ciao...