Mailing Lists: Apple Mailing Lists

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

Re: loginwindow



Thank you for your help. 
Actually that's the one we are currently following. The problem is that by watching changes in the current console user, we still can't distinguish logout from shutdown or restart because the console user becomes NULL when the machine shuts down and restarts as well. Do you have any idea on that? Thanks in advance.


On Mon, Nov 24, 2008 at 8:08 AM, Doug John <email@hidden> wrote:
I'm not sure why Q&A1133 changed, but here was the old link we still follow: http://serenity.uncc.edu/web/ADC/2005/Developer_CD_Series/August/%20What's%20New/Technical%20Notes%20and%20Q&As/ADC%20Reference%20Library/qa/qa2001/qa1133.html


On Wed, Nov 19, 2008 at 2:35 PM, Kevin Metha <email@hidden> wrote:

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


 _______________________________________________
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

References: 
 >loginwindow (From: "Kevin Metha" <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.