CButton::SetElevationRequired

Sets the state of the current button control to elevation required, which is necessary for the control to display an elevated security icon.

BOOL SetElevationRequired(
            BOOL fElevationRequired
);

Parameters

Parameter

Description

[in] fElevationRequired

true to set elevation required state; otherwise, false.

Return Value

true if this method is successful; otherwise, false.

Remarks

If a button or command link control requires elevated security permission to perform an action, set the control to elevation required state. Subsequently, Windows displays the User Account Control (UAC) shield icon on the control. For more information, see "User Account Control" at MSDN.

This method sends the BCM_SETSHIELD message, which is described in the Windows SDK.

Requirements

Header: afxwin.h

This method is supported in Windows Vista and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

See Also

Concepts

CButton Class

CButton Members

Hierarchy Chart

BCM_SETSHIELD