title: Is it possible to replace the Mac login screen?
body: <p>Is it possible to replace the Mac OS X login window, /System/Library/CoreServices/loginwindow.app, with a custom login window application?  (<a href="https://serverfault.com/questions/33856/is-it-possible-to-replace-the-macs-login-window">See my rational for doing so</a>.)</p>
  
  <p>I'm afraid my Cocoa programming skills are rudimentary.  I do find it interesting that, when I run probe CGSession (which is <a href="http://www.macosxhints.com/article.php?story=20031102031045417" rel="nofollow noreferrer">a undocumented utility that performs fast user switching)</a> to see what functions it uses, by doing</p>
  
  <pre><code>nm -mg /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession
  </code></pre>
  
  <p>that one of the linked function is:</p>
  
  <pre><code>(undefined [lazy bound]) external _CGSCreateLoginSession (from ApplicationServices)
  </code></pre>
  
  <p>I haven't found documentation on the ApplicationServices framework.  I suspect I'm getting deep into Service Provider Interfaces instead of Application Programmer Interfaces.</p>
  
  <p>I did find this really interesting snippet:  (<a href="http://74.125.93.132/search?q=cache:pf07a9f3agUJ:svn.alacatialabs.com/CGSInternal/trunk/Examples/SwitchToLoginWindow/main.c+CGSCreateLoginSession&amp;cd=5&amp;hl=en&amp;ct=clnk" rel="nofollow noreferrer">google cache</a>)  (<a href="http://svn.alacatialabs.com/CGSInternal/trunk/Examples/SwitchToLoginWindow/main.c" rel="nofollow noreferrer">direct link to down page</a>; it appears the site is undergoing re-organization) from an application that claims to switch to the login window even if fast user switching is disabled.</p>
  
  <pre><code>#include "CGSInternal.h"
  
  int main (int argc, const char * argv[]) {
      // switch to the login window
      CGSCreateLoginSession(NULL);
  
      return 0;
  }
  </code></pre>
  
  <p>I take CG to mean CoreGraphics, and don't understand what that has to do with logging in (except with perhaps putting a login dialog up over the current user's work).</p>
  
  <p>Even if it is not possible to achieve a replacement for the login window, I'd be interested to know what can be done along these lines (by people who don't work for Apple).</p>