views:

1132

answers:

4

I have been assigned an assignment to create such a service in delphi which will track the logged in user activity on the computer. For this i have to

  1. I want my service to be run in the background and should store the name of every ACTIVE window in particular time events.
  2. Learn how to create windows service in delphi

How should I get started?

+4  A: 

Create a Windows service in Delphi:

http://www.devarticles.com/c/a/Delphi-Kylix/Creating-a-Windows-Service-in-Delphi/

DannySmurf
A: 

and how would i get the acitve window (focused window) handle, it's title and other information? I guess i need to hook the windows messages for the window focus event. I am not sure am i going on right track or not?

alee
IMHO you are on the wrong track. There can be more then one person at a time be logged in. Do you want to track all sessions? Services usually don't have a UI build in and are not connected to any users logged in. You can make interactive services, but they are a security and stability risk.
Lars Truijens
A: 

The Service code from Aldyn is able to track logged in users. Not sure if it is what you want, but it must surely be a good start. The vendor goes through fits of activity and sleep, so be sure it does what you want as-is. Aldyn SvCOM

mj2008
A: 

You will want to do some research in the CBT hooks provided by the Microsoft SDK. They include the ability to be notified each time a window is created, among other things.

skamradt