Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

loginwindow



Does anyone have any idea how to detect that user logs out or that login window is displaying on the screen?


My program is launched via the startup item mechanism. It does some work after the current console user logs out. I tried System Configuration framework in which the name of the current console user can be returned as discussed in Tech Q&A1133. If multiple users are logged on and one of them logs out, the current console user will be "loginwindow". In that case, I know that login window is displaying on the screen so I know user just logs out. However, my program does not support fast-user swtiching and it only deals with single-user mode. After the user logs out or shuts down or restarts, the console user is all NULL so I can't actually distinguish logout from shutdown or restart. Also, I thought about getting notified when the setting changes but it came back to the same question how to tell that it's logout but not others.


I am thinking about checking if loginwindow is running and the current console user is NULL. If both of them are true, I know that user just logs out but I haven't tested this yet. Does anyone have a better idea on this? Thanks in advance.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.