Click to See Complete Forum and Search --> : Starting my program before login? Win XP
godronus
August 23rd, 2004, 03:04 PM
Is it possible to start my program running before a user has logged in? Somebody mentioned I might be able to run it as a service using FireDaemon. Cannot seem to get it to start at startup though. I am still having to manualy start the service. Is there another way to do this? Possibly without a service?
What I am trying to do is have my program run in the background.. Then at a specific time, do something for a specified period. The problem is if a user is not currently logged on my program won't run if I add it to the startup menu. I am running windows xp. developing with Bloodshed Dev - C++.
Would it be possible to get my program to log on as a user at the specified time?
Mick
August 23rd, 2004, 03:13 PM
You need to create it using the Service API's. It sounds like your not doing that (using srvany?). Or your not setting the correct configuration when you call CreateService(...)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/services.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/writing_a_servicemain_function.asp
If it is something that should be done at X date/time then you can also think about the task scheduler.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/taskschd/taskschd/itask.asp
bLogik
August 23rd, 2004, 03:42 PM
login etc is handled by msgina
you can use this stub as a starting point
http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5683/
Mick
August 23rd, 2004, 03:44 PM
login etc is handled by msgina
you can use this stub as a starting point
http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5683/
And this relates in what way to the question being asked?
bLogik
August 23rd, 2004, 03:47 PM
in this way -> Would it be possible to get my program to log on as a user at the specified time?
you could log on automatically with a special user at a given time and instead of running userinit run your own app. for all other user you of course still do userinit.
then you can define a sas sequence, which gets triggerd when your special user is finished and you log off again
Mick
August 23rd, 2004, 03:51 PM
in this way -> Would it be possible to get my program to log on as a user at the specified time?
you could log on automatically with a special user at a given time and instead of running userinit run your own app. for all other user you of course still do userinit.
then you can define a sas sequence, which gets triggerd when your special user is finished and you log off again
Using a sledgehammer to drive a nail.... :D
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.