happen when ever user log-in

nagasrikanth

New member
Joined
Feb 1, 2008
Messages
1
Programming Experience
Beginner
Hi All,

This is my first post in these forums.

Actually I have developed a windows service which will posts some data to SQL Server. I have set its start type to "Automatic", So that When ever system is restarted I will get the updated data in to my sql server.

Now the problem is, I want to make this happen when ever user log-in to the system. (not at the time of restarting.Co'z Many of my users will not restart at least once in a day, But they will surely log in to the system twice in a day)
How can I do that?? One best Idea I got is, Placing entry into System Registry ( in HKLM\Software\micros......\Run) that too at the time of set up it self. How can I do that??
Is there any other alternate for my prob??

Plz help..
 
Windows services live a life independent of desktop users and their logon sessions, startup shortcuts and "Run" key is for desktop applications only. What you have to do is enable CanHandleSessionChangeEvent and override OnSessionChange where you inspect changeDescription.Reason. I know the documentations says its for Terminal Server sessions, but it worked fine with my standalone Windows XP.
 
Back
Top