How to switch to "Login Window" using cocoa?

From my cocoa application I need to programmatically switch user desktop to Login Window.
The analog of this function is "Login Window" item near the user list menu in the status area (Fast User Switching, Session switch).
I need this API under 10.6
thanks!

In the Terminal, type
{code}/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend{code}
So you just have to perform a system call to run this command.

Similar Messages

  • If the production database i down, how to switch to standby database using the replication environment in ASsE

    This question is in Business Continuity Plan (BCP)
    if the production database is down, how to switch to standby database using the replication environment in ASE

    Assuming you're referring to Sybase's Replication Server (repserver) product ...
    Repserver moves data changes from one database to another.
    Repserver can't 'switch' your application to use a different database; something outside of repserver has to do the actual switching.
    If your application happens to be connecting to your ASE via Sybase's OpenSwitch (or similar) product, then OpenSwitch would be responsible for switching your application to use the standby database.  Whether you have OpenSwitch perform the switch automatically, or via a manual command, is up to your BCP requirements.
    If your application connects directly to ASE then you'll have to decide how/when to get your application to switch to the standby database.  In the simplest form this would require shutting down the application, making sure replication is quiesced (ie, all in-flight transactions have been applied to the standby database), modify the interfaces/sql.ini file (used by your application) to point to the standby database, make any customized changes to the standby dataserver/database (eg, unlock application logins, take databases out of 'dbo use only' mode, etc), and startup the application (at this point it should connect to the standby database per the changes to the interfaces/sql.ini file).

  • How to switch between 2 windows of the same application using Cmd+Tab

    Hi,
    I am using my mac now since about 10 months. I was used to work with Linux and Windows XP.
    Something I am badly missing on mac os x is the possibility to switch between 2 windows of the same application using cmd + tab just like it simply works for Linux and Windows (and maybe many other OS out there!).
    Very often I have 2 text files open in 2 editor windows (e.g. TextEdit) and need to copy and paste text from one window to the other. I was used to simply use ALT+TAB. But here I have to get my right hand away from the keyboard and use the mouse to change the focus from one window to the other and then use the mouse again to get the focus back to the previous TextEdit windows.
    THIS REALLY *****!!!! It makes me crazy. I cannot believe that such a "modern" OP does not support this action. I must be doing something completely wrong or did not understand the mac correctly. Right?
    Does anyone have an idea how I can get mac to do something all other operating systems so easily do?
    Thanks
    Quartz84

    Hi Kappy,
    well what you are saying is obvious to me. This is not the point for me and not what I wanted to know. But I think you answered my question anyway: OS X is unable to switch between windows of the same application as I mentioned in my example.
    WHY NOT???
    Every other OS is able to differentiate between windows and not just applications.
    Another example: The Mail application and an Email editor window. When you are writing an Email and you want to switch to the main window of the Mail application to read something you must again use the mouse!
    I mean Apple seems to be "somehow" using FreeBSD in the background and even in FreeBSD's window manager it is possible to switch between windows of the same application.
    Well, in the Apple world it is always the pour user who is not intelligent enough to understand Apple's philosophy ;-(
    To me this is not modern, it is simply a weakness of the OS.
    Cheers
    Quartz84

  • How to Get the Login Window and/or Bypass Login Items?

    Greetings, folks!
    This is a silly question, but the old standby of “hold down the shift key” doesn’t work in 10.6.1:
    What key(s) need to be pressed to get the LogIn window and then after LogIn, to bypass LogIn Items?
    Thanks!!
    Richard Fairbanks

    Not here, on a fresh (erased) install.
    Pressed either before or after the initial gray Mac appears, the shift key does not access the LogIn screen. It is possible to bypass the account’s LogIn items by holding down the shift key after the LogIn screen has been called and successfully commenced, but how does one call the Login screen when the Mac is normally set up for automatic login?
    It used to be the shift key . . . 
    Thanks!

  • How to switch CC from Windows to Mac

    I have Creative Cloud on my Windows desktop and laptop. I am considering moving to a new Macbook Pro. How do I switch CC from Windows to Mac?
    Thanks,
    Mike

    I appreciate the advice, but I've discovered that my OS has to be updated first (was 10.6.8) and am in the process of upgrading to Yosemite. Then I will try to login to Creative Cloud on the Mac and from there navigate as you describe. I hope to report this worked!
    Mike

  • Panic after switching to Login Window

    Background/Recent changes (new to old):
    (12/27) Installed a Blue Tooth Mighty Mouse
    (12/26) Installed 10.5.1 update (http://www.apple.com/downloads/macosx/apple/macosx_updates/macosx1051update.html) to eliminate all but one "Warning: SUID file" disk permission warnings. The following post relates: http://discussions.apple.com/thread.jspa?messageID=6030410&#6030410
    (12/23) Installed Security Update 2007-009 (Updater would not install, error occurred during restart. Installed by downloading update directly from Apple Support). This post relates:
    http://discussions.apple.com/message.jspa?messageID=6187227#6187227
    Problem:
    Error requiring shutdown appeared after selecting "Login Window" from the accounts drop down list.
    This is the log after restarting:
    Sat Dec 29 10:14:17 2007
    panic(cpu 1 caller 0x001A7BED): Kernel trap at 0x2147f059, type 14=page fault, registers:
    CR0: 0x80010033, CR2: 0x2147f059, CR3: 0x010bb000, CR4: 0x00000660
    EAX: 0x00000001, EBX: 0x03e4e4e4, ECX: 0x00000000, EDX: 0x03e5e0b0
    CR2: 0x2147f059, EBP: 0x217b7dd8, ESI: 0x06283e04, EDI: 0x034f3330
    EFL: 0x00010246, EIP: 0x2147f059, CS: 0x00000008, DS: 0x02d00010
    Error code: 0x00000010
    Backtrace, Format - Frame : Return Address (4 potential args on stack)
    0x217b7bc8 : 0x12b0e1 (0x455670 0x217b7bfc 0x133238 0x0)
    0x217b7c18 : 0x1a7bed (0x45ea20 0x2147f059 0xe 0x45e1d4)
    0x217b7cf8 : 0x19e517 (0x217b7d10 0x1ff2fc 0x217b7dd8 0x2147f059)
    0x217b7d08 : 0x2147f059 (0xe 0x48 0xa0010 0x10)
    0x217b7dd8 : 0x3a0b44 (0x34f3330 0x1 0x1b158f0 0x7583308)
    0x217b7df8 : 0x3a2555 (0x34f3330 0x9 0x0 0x369144)
    0x217b7e58 : 0x3a26f3 (0x34f3330 0x1 0x217b7ea8 0x3751a9)
    0x217b7e78 : 0x364171 (0x34f3330 0x217b7ec8 0x217b7ec8 0x141c4d)
    0x217b7ee8 : 0x364562 (0x35bcab0 0x757c888 0x75832b0 0x2)
    0x217b7f28 : 0x36461e (0x0 0x4 0x217b7f5c 0x1)
    0x217b7f78 : 0x3da847 (0x75832b0 0x4314860 0x43148a4 0xbffff11c)
    0x217b7fc8 : 0x19ea34 (0x4fc0760 0x0 0x1a10b5 0x4fc0760)
    No mapping exists for frame pointer
    Backtrace terminated-invalid frame pointer 0xbffff348
    BSD process name corresponding to current thread: parentalcontrols
    Mac OS version:
    9B18
    Kernel version:
    Darwin Kernel Version 9.1.0: Wed Oct 31 17:46:22 PDT 2007; root:xnu-1228.0.2~1/RELEASE_I386
    System model name: iMac7,1 (Mac-F42386C8)
    Question:
    Programs used have been operating without any events. Can someone please explain the error, cause any required resolution?

    I have had this same parentalcontrols kernel panic crash my system 4 times today--every single time I try to switch from my child's managed account to my own admin account. I can't seem to find anything on the discussions board that suggests a fix. Does anyone know if this bug will be corrected in 10.5.2? Or is there a workaround that doesn't involve turning off parental controls?
    This kind of instability isn't what I'd expect from OS X.

  • Full screen mode: How to switch between open windows?

    Hi There,
    Is there way to get CMD + ` working in full screen mode?
    Other shortcuts like CMD + OPT [ ] to switch between open tabs and CMD + TAB to switch apps seem to work - but without the ability to switch between open windows within the same app, full screen mode is kind of useless.
    Any pointers in the right direction would be much appreciated.
    BTW I'm using Yosemite but the forums won't find a Yosemite community (not sure the community search is working properly)
    Cheers

    or:
    And some additional shurtcuts:
    OS X: Keyboard shortcuts - Apple Support
    http://www.danrodney.com/mac/
    cmscss wrote:
    Hi There,
    Is there way to get CMD + ` working in full screen mode?
    Feedback: www.apple.com/feedback/

  • How to set password login window appear for 'Mac Mail' app?

    This is possible, when we remove the email password from my keychain using account preference. But some of our client wants login window password which is different from email password.
    Is this possible??

    no. but if you protect your iPhone with a password, I don't think you need a separate one just for your email.

  • How to access ports in windows using JDK 1.5 or later

    Hi,
    My task is to read an input from the parallel port and use a modem to dial a phone number connected to a seril port .
    At the same time i am generating an SMS depending on the input i read from parallel port.To run this SMS program i need a new version of java.
    I've been searching for days to find a way to access serial port in a new version.I managed only 1.1.8.
    Please..
    If someone has any idea may i know how to copy the necessary files (dll and packages) to JDK 1.5 or later please let me know.
    I'm using windows platform:(
    Thanks
    goodnews
    If anyone needs info about Accessing ports in windows using jdk1.1.8 just post below..I'll give what i have.

    user12858801 wrote:
    Hello,
    Has there been any development with this post?after 3 years, what do you think?

  • How to switch off the computer using the key on the keyboard?

    Hi,
    i've been using Mountain Lion for a while on my MBPr and when I wanted to switch off my mac, I used the key on the dashboard, then it asked me whether I wanted to switch off, restart or go on sleep mode... Now though with Mavericks, this button only makes it go on sleep mode...how to change the function of this key, in order to switch the computer off instead of sleep mode or how to get the window asking me what to do back?
    Thanks,
    BadGoldEagle

    It's a laptop, and when I don't use it i put it in a case and hide it (I've been burgled several times and I don't want to lose my Mac...
    About my friend: He was using his laptop when he had to go out (groceries....) and because he was in bed, he left it under his blanket to hide it form view... he put his computer to sleep. Unfortunately, windows update noticed something needed to be updated and switched back on the computer and during the update, it became kinda hot and it burned the CPU... bad...
    You'll understand I don't want to do that to my mac...
    And now all i have to do is wait 'till Apple brings an update to fix that...

  • How to prevent multiple logins by using HttpBindingListener

    Hi,
    Can anyone tell me how do i actually use session to prevent multiple login from different machine? From my understanding, i need to use HttpBindingListener to valueBound and valueUnbound when user tries to login, but i encounter a problem is my session is always overwritten since i use setAttribute() method in servlet.
    For instance i use username(aaa & bbb) to login in two different machine, my login is always overwritten if i use username bbb to login after username aaa. i know it is because setAttribute() method overwrite existing session data, so i would like to know what other method should i use to achieve what i want, tks.

    Hi,
    This is the logic for session :
    Connect to db for verification, once verified, system return a UserBean and this UserBean will be set in ClientSecurityEngine
    When this particular user has been successfully verified, a new session will be created
    if(success)
        session = request.getSession();
        User user;
        synchronized(session)
        user = (User) session.getAttribute("user");                       
        if(user == null)
           user = new User(ClientSecurityEngine.getInstance().getUserBean().getUsername());
           session.setAttribute("user", user);
    /* User class */
    public class User implements HttpSessionBindingListener {
        private static Map<String, HttpSession> logins = Collections.synchronizedMap(new HashMap<String, HttpSession>());
        private String username;
        public User(String username) {
            this.username = username;       
        public String getUsername() {
            return username;
        @Override
        public void valueBound(HttpSessionBindingEvent event) {
            if (logins.containsKey(getUsername())) {
                HttpSession session = logins.remove(getUsername());
                if (session != null) {
                    session.invalidate();
                logins.put(getUsername(), event.getSession());
            } else {
                logins.put(getUsername(), event.getSession());
        @Override
        public void valueUnbound(HttpSessionBindingEvent event) {
            logins.remove(getUsername());
    }Edited by: EJP on 21/07/2011 14:22: added {noformat}{noformat} tags so we can actually read your code. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to switch from CS6 windows version to mac version?

    In December 2012, I upgraded to photoshop CS6 for windows, but my computer didn't meet system requirements and I have been unable to use CS6.  I am now able to buy a new computer and want to switch to a mac.  Will adobe provide me with a new serial number to switch to mac without charge?
    Thanks.

    Follow these steps to request a platform swap
    Order product | Platform, language swap

  • How to make a login system using xCode?

    Hello guys!
    I'm trying to make a login system;
    Is it possible to make it like this:
    Put a text box for the username and password and a label called "Sign in"
    How can I make so that the username and password box get's my input box on my PHP website and that "Sign In" will be the Submit?
    I don't want to use the HTTP way...
    Thank you !

    Thanks for your answer !
    Before I made this topic I tried to find a tutorial here and I didn't find any...
    Can you please redirect me to one of them?
    Thank you

  • How do I hide ALL windows using apple H?  The final window stays open.

    When I press apple-H it hides the windows except the last one.  To hide that one I have to click on the desktop, then back to the window, then press apple H again to hide it. 
    Is this an intentional function of Mac's operating system?  Seems awkward, and it's certainly annoying as I have to access the desktop many times during my work day.  I realize I can press F11 and get the desktop, but that merely pushes windows to the side and when I open something new they come back on screen and interrupt my workflow.
    I would like to be able to press apple-H multiple times (or a different shortcut) until I reach a clean and clear desktop.  So if I have 3 applications open, I want to press apple-H 3 times and to reach the desktop.  When I open a folder, I don't want the windows that were pushed aside to slide on screen blocking my workflow.

    Why not use multiple desktops?
    I have 5 desktops being used. Desktop 1 is my "working" desktop where I open/close apps/windows a lot. While I keep Calendar on desktop 2, full screen. Mail on 3 at full screen, iTunes on 4 full screen and Stickies, Reminders and Notes on desktop 5.
    As I typed this, I tested it out. I opened Messages along with Safari (obviously) on my desktop 1. I then pressed Command H twice. Both Messages and Safari disappeared leaving me with a clean desktop. But it left all my other desktops alone and left each of the apps/windows opened on their desktops. I think this would be a great solution for you as you can leave apps/windows opened on other desktops with out having to disrupt your work flow on your main desktop.
    You can also assign an app to open just on one particular desktop. As with me, I have all of those apps to open at start up. But on that desktop that it's assigned to. Example I opened Calendar on desktop 2. Then I right clicked the App in the Dock, scrolled to Options then selected "Assign to This Desktop". And so on with the remaining desktops and apps.
    To move between desktops, since you have a Trackpad, just swipe back and forth with four fingers. Or if you are on desktop 1 and want to get to find quickly. You can either click on the app that is assigned to desktop 5, in my case Notes, Stickies or Reminders. Or you can 4-finger swipe up then select desktop 5.
    KOT

  • How can we close the window using a button in applet?

    I have a close button in my applet which should close the browser from where the application is launched. Can somebody post a sample code for doing the same?

    I'm afraid I don't have any sample code, but I can describe a possible solution.
    1. Retrieve the JSObject via Application.[url http://docs.oracle.com/javafx/2/api/javafx/application/Application.html#getHostServices%28%29]getHostServices().[url http://docs.oracle.com/javafx/2/api/javafx/application/HostServices.html#getWebContext%28%29]getWebContext()
    2. Use the JSObject to manipulate the JavaScript into closing the Window.

Maybe you are looking for

  • Trying to connect my iMac to on 10.8.2 with PowerBook Intel on 10.5.8; sharing works from PowerBook to iMac but not the other way around. Why?

    Trying to connect my iMac to on 10.8.2 with PowerBook Intel on 10.5.8; sharing works from PowerBook to iMac but not the other way around. Why?

  • How to design multi-languages site?

    Hi: I try to store user profile in the database. Since chinese is double byte, and english is not. Does anyone tell me what is advantage and disadvantage to choose defining a user table for all the users or to defining two tables, one for double byte

  • Regarding Upgradtion Information

    Dear Guru    I just want to know that what are the things that are required when we upgrade the project from ECC 4.7 to ECC 6.0. If anybody have some document and anythings regarding this plz send to me... Thanks. Moderator message - Please search be

  • Photo titles in iPhoto

    When I name (title) a photo in iPhoto 6.0.2, the title appears in the information window under title. If I go to Pictures/iPhoto Library/Originals/2006/, the album that I highlight has all of the pictures titled with a number, for example P101001.JPG

  • Error Connecting to the EDS(Essbase Delpoyment Services)

    I am given supervisor access to the Databases. I can Create/Delete Applications. But, when I did right clicking on the database and select Preview Data, It displays an error message "Exception: failed to connect to the EDS Server for Grid View. Canno