title: Hook windows logon/logoff events
body: <p>I am having a service which would be running at SYSTEM level. Now, i want to track the logged on user in it. Earlier i was trying to get the logged in user name from GetUserName api but in my case it returns "SYSTEM" every time. </p>
  
  <p>Is there anyway to get logged on username in my case? or is there any hook that i can install so that i may get which user logged on?</p>
  
  <p>P.S:
  I am mainly working in Delphi 2007 but these question are specific to the Win32 API. </p>