LocationDisp.LatLongReportFactory.RequestPermissions method

[The Location API object model is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, to access location from a website, use the W3C Geolocation API. To access location from a desktop application, use the Windows.Devices.Geolocation API.]

Opens a system dialog box to request user permission for location-enabled devices.

Syntax

LocationDisp.LatLongReportFactory.RequestPermissions(
  hWnd
)

Parameters

hWnd

This parameter is not used and should be set to zero.

Return value

This method does not return a value.

Remarks

The call is synchronous and the caller waits for the dialog box to be closed.

Note

If an application running in protected mode, such as a Browser Helper Object (BHO) for Internet Explorer, calls RequestPermissions, and the user chooses the Don't enable this location sensor option in the dialog box, the location provider will not be enabled, but Windows will display the dialog box again if RequestPermissions is called again by the same user. Applications that run in protected mode may choose to not call RequestPermissions on startup so that the user does not see a possibly unwanted dialog box each time the application starts.

Examples

For an example of how to use this method, see Listening for LatLong Report Events.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported