2

I am using:

    if (CGCaptureAllDisplays() != kCGErrorSuccess) {

To capture the display and secure my app while the user is away, but users have reported, and I have confirmed that pressing simply force quits my app.

How can I stop that behavior?

JeremyLaurenson
  • 979
  • 2
  • 11
  • 23

1 Answers1

1

I believe what you want is a kiosk environment; see Apple's Technical Note TN2062: Creating Kiosks.

Specifically, you'll want to use -[NSApplication setPresentationOptions:]; see NSApplicationPresentationOptions here for possible values.

echristopherson
  • 6,974
  • 2
  • 21
  • 31
  • Im using CGCaptureAllDisplays(); and Application is agent (UIElement): YES, which does not seem to support this, or creating an EventTap – JeremyLaurenson Feb 26 '13 at 03:10
  • I have been messing with this for hours, and can not get setPresentationOptions to stop Mission control working when run outside of XCode. Anyone have working code that programatically creates a full-screen NSWindow "Lock Screen" that blocks the desktop, other apps etc, with simple button that then closes it if pressed. – JeremyLaurenson Feb 26 '13 at 12:27
  • I was about to point out http://stackoverflow.com/questions/10660996/lock-screen-on-mac-app but it looks like you've already found it. If this doesn't work, I'm out of ideas. – echristopherson Feb 26 '13 at 17:38