reference:plugins:plugin_sdk:registry_functions:opusregcheckelevation

OpusRegCheckElevation(
     OPUSREGKEY:phKey,
     HWND:hWnd
)
→ LONG

Arguments

phKey

[in] The open registry key to check.

hWnd

[in] Parent window handle for the UAC elevation dialog. Set to NULL to suppress the UAC dialog.

Return value

The following values may be returned:

OPUSREG_ELEVATIONCANCELLEDElevation was required, but the user cancelled the UAC dialog (or hWnd was set to NULL)
OPUSREG_ELEVATEDElevation was required and successfully obtained
OPUSREG_ELEVATIONNOTNEEDEDElevation is not required to write to this registry key

Description

The OpusRegCheckElevation function lets you check if elevation is required to write to an open registry key under Windows Vista. If elevation is needed the UAC elevation dialog is automatically displayed.

Writing to the registry is discouraged for plugins - this function is provided to make it easier for you to convert existing registry-based plugin configuration data to new-style XML configuration data.