Edit

Share via


ILocationPermissions::GetGlobalLocationPermission method (sensorsapi.h)

Important

Use the UWP Sensor API instead.

The COM-based Sensor API is deprecated and should not be used in new applications. No additional features or enhancements are planned, and support will be limited.

Gets the status of the system setting that allows users to change location settings.

Syntax

HRESULT GetGlobalLocationPermission(
  [out] BOOL *pfEnabled
);

Parameters

[out] pfEnabled

TRUE if system settings allow users to enable or disable the location platform; otherwise, FALSE.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_POINTER
NULL was passed in for pfEnabled.

Remarks

Note  GetGlobalLocationPermission is available in Windows 8.
 
For more information on location settings in Windows 8 see Location settings.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header sensorsapi.h
Library Sensorsapi.lib
DLL Sensorsapi.dll

See also

ILocationPermissions