LockOnLeaveOptions Class

Definition

Provides the ability to manage the locking behavior of the PC screen based on whether a user is detected by the human presence sensor.

public ref class LockOnLeaveOptions sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 983040)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LockOnLeaveOptions final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 983040)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LockOnLeaveOptions
Public NotInheritable Class LockOnLeaveOptions
Inheritance
Object Platform::Object IInspectable LockOnLeaveOptions
Attributes

Windows requirements

Device family
Windows 11 Insider Preview (introduced in 10.0.23504.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v15.0)

Remarks

Introduced in the May Moment update for Windows 11, Version 22H2, Build 22621.

The user can specify their preferred lock on leave behavior in the System settings (see Launch the Windows Settings app).

Properties

AllowWhenExternalDisplayConnected

Gets or sets whether lock on leave behavior is enabled when an external monitor is connected to the system.

Applies to

See also