flat assembler
Message board for the users of flat assembler.
Index
> Windows > Monitor user login/logoff |
Author |
|
wisepenguin 28 Mar 2006, 12:35
if you leave the program running when the user logs in, you can process
the WM_QUERYENDSESSION and WM_ENDSESSION messages. they inform you when a logoff/restart etc is about to take place. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shutdown/base/wm_endsession.asp |
|||
28 Mar 2006, 12:35 |
|
vid 28 Mar 2006, 12:38
why not the hook?
|
|||
28 Mar 2006, 12:38 |
|
kasake36 28 Mar 2006, 12:40
Ahh. Great, thank you wisepenguin!
About the hook: i read in Icezelion's Win32 Hook tutorial about the several types of hooks and understood it so, that hooks only make sense when you want to trap events in other applications. Now, after reading the tut a second time, i think i was wrong, hehe... So you would suggest a hook? I think for my purpose this maybe would not make much sense, since at logon i autostart a program which, at logoff, receives the WM_QUERYENDSESSION call to shutdown... There are no other events i need...? After reading the help about WM_QUERYENDSESSION, i think it works this way (please correct me): Windows sends WM_QUERYENDSESSION to all programs. If mine and all others return 0, then Windows checks the results and returns WM_ENDSESSION to all programs to let them know if Windows is shutting down? |
|||
28 Mar 2006, 12:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.