loginwindow
loginwindow
- Subject: loginwindow
- From: "Kevin Metha" <email@hidden>
- Date: Wed, 19 Nov 2008 14:35:42 -0800
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:
This email sent to email@hidden