views:

41

answers:

1

How can i programatically check if the windows shell (explorer) has loaded all startup programs & the user login process is over ?

+2  A: 

There is a somewhat documented event you can wait for, but it is signaled when explorer has started loading. On XP this event is called "msgina: ShellReadyEvent" and "ShellDesktopSwitchEvent" on Vista. I linked to the sources of some alternative shells in a post related to this event.

Another alternative would be to listen for the Taskbar Creation Notification message. It can fire more than once so you would need to keep track of that.

On Vista+ there is one last alternative that might just work: Programs set to run at startup are part of a job object so they cannot run at high priority. If your program runs at startup you could maybe check for this, either by using IsProcessInJob or SetPriorityClass+GetPriorityClass in a loop. (SetPriorityClass will lie about its return value IIRC)

Anders