Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

SetSystemUIMode

Sets the system UI mode.

Component Version macOS Windows Linux Server iOS SDK
SystemUIMode 2.1 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "SetSystemUIMode"; Mode; Options )   More

Parameters

Parameter Description Example
Mode The mode you want. 1
Options The options you want. 0

Description

Sets the system UI mode.

The System UI Mode controls the presentation of system-provided user interface elements.

Note that the system UI mode is a per-process state. Switching from a process that is suppressing
system UI to another process that is not will cause system UI elements to become visible
automatically. Switching back to the first process will suppress system UI elements again.

In this mode, all standard system UI elements are visible.

kUIModeNormal = 0

In this mode, system UI elements which cover the "content area" of the screen (the area other than
the menubar) are hidden. However, these elements may automatically show themselves in response to
mouse movements or other user activity; specifically, the Dock will still show itself automatically
when the mouse moves into the Dock's auto-show region.

kUIModeContentSuppressed = 1

In this mode, system UI elements which cover the "content area" of the screen (the area other than
the menubar) are hidden. Unlike kUIModeContentSuppressed, most UI elements will not automatically
show themselves in this mode.

kUIModeContentHidden = 2,

In this mode, all system UI elements, including the menubar, are hidden. However, these elements may
automatically show themselves in response to mouse movements or other user activity; specifically,
the Dock and menubar will still show themselves automatically when the mouse moves into the Dock's
auto-show region. Available in macOS 10.3 and later.

kUIModeAllSuppressed = 4,

In this mode, all system UI elements, including the menubar, are hidden. Most system UI elements
will not automatically show themselves in this mode. The application may request that the menubar
automatically show itself while in this mode by passing the kUIOptionAutoShowMenuBar flag to
SetSystemUIMode.

kUIModeAllHidden = 3

Options which you can combine by adding them together:

Requests that the menubar automatically show itself when the user moves the mouse into the screen
area that would ordinarily be occupied by the menubar. Only valid with kUIModeAllHidden.

kUIOptionAutoShowMenuBar = 1

Disables all items in the Apple menu. Valid for all modes.

kUIOptionAnimateMenuBar = 2

Requests that the menubar animate on or offscreen, if the UIMode is also being changed such that the menubar will change visibility. Unlike other UI options, this option is not stored and only affects the behavior of this call to SetSystemUIMode. Valid for all modes. Available in Mac OS X 10.7 and later.

kUIOptionDisableAppleMenu = 4

The active application may not be changed while this process is active. Currently disables the
Command-Tab and Command-Shift-Tab key sequences to switch the active process, and the global window
rotation key sequence selected by the user in the Keyboard preference pane. SetFrontProcess may
still be used to explicitly switch the active process. Only valid with modes other than
kUIModeNormal.

kUIOptionDisableProcessSwitch = 8

The Force Quit window may not be displayed while this process is active. Currently disables the
Command-Option-Escape key sequence to open the Force Quit window and the Force Quit menu item in the
Apple menu. Only valid with modes other than kUIModeNormal.

kUIOptionDisableForceQuit = 16

The current login session may not be terminated while this process is active. Currently disables the
Power key and the Restart, Shut Down, and Log Out menu items in the Apple menu. Only valid with
modes other than kUIModeNormal.

kUIOptionDisableSessionTerminate = 32

The Hide menu item in the Application menu is disabled. Note that this option does not prevent this
application from being hidden if Hide Others is selected in some other application. Available in Mac
OS X 10.3 and later.

kUIOptionDisableHide = 64

Provides the ability to specify whether the menu bar will disable its adaptive transparency. Note
this should be used in conjunction with a full-screen window using kUIModeContentSuppressed or
kUIModeContentHidden. Available in macOS 10.6 and later. This constant was published in the Mac
OS X 10.5 version of MacApplication.h, but had the wrong value (7) and should not be used in Mac OS
X 10.5.

kUIOptionDisableMenuBarTransparency = 512

Examples

Sets mode with hidden content:

MBS("SetSystemUIMode"; 1; 0)

See also

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 10th August 2020


ServiceProvider.Value - SharedMemory.Exists