CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Location
    Cochin
    Posts
    83

    Exclamation 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
    "I studied everything but never topped. Today, toppers of the world's best universities are my employees"

    -William Henry Gates (Bill Gates)

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Help me : How to write a file when user log in and logout in Windows

    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.

  3. #3
    Join Date
    Apr 2009
    Location
    Cochin
    Posts
    83

    Smile 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...

    sorry. if i'm wrong...

    thanks in advance
    "I studied everything but never topped. Today, toppers of the world's best universities are my employees"

    -William Henry Gates (Bill Gates)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured