views:

30

answers:

1

Is there a way to know whether user is completely logged in or not into system? I mean, i wanted to know whether initial login process, other initialization processes are done or not. Once those are done, i want to launch my application. So, in my service(installed before sys shutdown) i want to keep on checking whether everything is done or not, based on the result i want launch my app.

+1  A: 

I'm not sure what you mean about "completeley logged into the system". The user can be logged in, or not; I don't get how he could be uncompletely logged.

If you want to launch an application when the session is opened, there are several ways of doing this:

  • Adding a shortcut in the "Startup" folder, in the "Start" menu
  • Adding a "Run" key in the registry (either in HKLM or HKCU depending on what your application does)

Your application can then detect if the session is about to close, listening to some specific Windows events, if it needs to.

If your application is a service, it can depend on other services and will wait for them to be started before starting itself.

If you just want to detect when the opened session is "ready to use", I'm afraid there is no good way to do this. The user could have some custom softwares launched on startup and there is no generic way to detect when these softwares were started.

ereOn
I'm able to fix this using whether LogonUI.exe is running or not. this process halts when credentials are correct and user login. But during shutdown\logoff, if there is any shutdown\logoff blocker call(like unsaved worddoc), there will be two options 1) force shutdown\logoff, 2)cancel, if you press cancel, winlogon launches LogonUI.exe and makes it run forever. So my decision making logic fails in this corner case. i donot understand why LogonUI.exe runs forever like this. :(
calvin
"listening to some specific Windows events"--> could you please eloborate it?
calvin
@calvin: I don't have the ability the check this now but take a look at `WM_ENDSESSION` messages. (Maybe using a *hook* ?)
ereOn