ShutDown ou Reboot : WM_QUERYENDSESSION ou WM_ENDSESSION

Résolu
cs_mfrai02 Messages postés 18 Date d'inscription jeudi 6 mars 2003 Statut Membre Dernière intervention 22 février 2007 - 22 févr. 2007 à 16:18
cs_mfrai02 Messages postés 18 Date d'inscription jeudi 6 mars 2003 Statut Membre Dernière intervention 22 février 2007 - 22 févr. 2007 à 16:33
Salut,

lorsque je veux traiter le message WM_QUERYENDSESSION ou WM_ENDSESSION, je peux déterminer grace au lParam si l'utilisateur à réaliser un logoff ou un shutdown (MSDN -> Windows 2000/XP: If this parameter is zero, the system is shutting
down.)
Mais j'ai pas trouvé comment faire la différence entre un reboot et un shutdown.

  LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
WM_QUERYENDSESSION, // the message to send
WPARAM[ wParam], // not used
LPARAM[ lParam] // logoff option
);

Merci par avance si vous pouvez me donner la solution.

MaT

3 réponses

yoyo269 Messages postés 1403 Date d'inscription lundi 23 février 2004 Statut Membre Dernière intervention 11 janvier 2009 2
22 févr. 2007 à 16:31
Voilà un extrait de la MSDN :
LRESULTCALLBACKWindowProc(
HWNDhwnd, // handle to window
UINTuMsg, // message identifier
WPARAMwParam, // not used
LPARAMlParam // logoff option
);

Parameters
* hwnd : A handle to the window. * uMsg : <dd>The WM_QUERYENDSESSION identifier. * wParam : <dd>This parameter is reserved for future use. * lParam : <dd>This
parameter can be one or more of the following values. If this parameter
is 0, the system is shutting down or restarting (it is not possible to
determine which event is occurring).Value |Meaning |----
ENDSESSION_CLOSEAPP
0x1, The
application is using a file that must be replaced, the system is being
serviced, or system resources are exhausted. For more information, see Site officiel de YoyoCut, découpe fichiers open source]
3
yoyo269 Messages postés 1403 Date d'inscription lundi 23 février 2004 Statut Membre Dernière intervention 11 janvier 2009 2
22 févr. 2007 à 16:27
Salut !

Je ne veux pas trop m'avancer mais il me semble qu'on ne peut pas savoir justement.

YOYO, @+.
"L'intelligence c'est comme un parachute, quand on en n'a pas...on s'écrase !"
____________________________________________
[Site officiel de YoyoCut, découpe fichiers open source]
0
cs_mfrai02 Messages postés 18 Date d'inscription jeudi 6 mars 2003 Statut Membre Dernière intervention 22 février 2007
22 févr. 2007 à 16:33
c'est bien ce qui me semblait aussi, merci pour ta réponse en tout cas.
Je sais pas s'il y a un moyen de contourner ce problème je vais faire des recherches !!!
Encore merci !
0
Rejoignez-nous