I think this is very difficult ground here!
What exactly does the application have to do?

If it is to run on NT/Win2000 then you can create a 'Service' which is not affected by a user logging off, but if a different user logs on to the machine, a different execution thread will started!

Post your intentions, as perhaps it can be overcome in another way.