Help me : How to write a file when user log in and logout in Windows
Hi i need to log the details of user login in Windows such as login time, login date and day etc and write it to a text log file... okay, i can get all these details with GetSystemTime() API.. but, i dont know how to get the logon and logoff events. :(
I know the Run key method in registry and startup folder method.. but those things wont solve my problem because i need to log these things each time user logs in and logs off.
I need to write the textfile if current user logs off(not shutdown) and after sometime he logs on(without restart/shutdown).
can anyone please help me... thanks in advance :)
Re: Help me : How to write a file when user log in and logout in Windows
Quote:
I know the Run key method in registry and startup folder method.. but those things wont solve my problem because i need to log these things each time user logs in and logs off.
If you put your application in the startup folder, you know that the user just logged on as soon as your application starts. If you application keeps running during the time the user is logged on, then you know that as soon as your application is closed, the user is logging off.
Re: Help me : How to write a file when user log in and logout in Windows
@ Skizmo
Thanks a lot, i doubt it really happens... because, when i logs off my system with Internet Explorer and other applications running, they wont get terminated.. and when i re-login again, those applications will still be running... so, is the case with Antiviruses and all... so, how can my application too terminate when Windows User is logging off... :confused:
sorry. if i'm wrong... :D
thanks in advance :)