ILocation 接口 (locationapi.h)

[Win32 位置 API 可用于“要求”部分中指定的操作系统。 它可能在后续版本中变更或不可用。 请改用 Windows.Devices.Geolocation API。 ]

提供用于管理位置报告、事件注册和传感器权限的方法。

继承

ILocation 接口继承自 IUnknown 接口。 ILocation 还具有以下类型的成员:

方法

ILocation 接口具有这些方法。

 
ILocation::GetDesiredAccuracy

检索当前请求的准确性设置。
ILocation::GetReport

检索位置报告。
ILocation::GetReportInterval

检索报告事件之间的请求时间量(以毫秒为单位)。
ILocation::GetReportStatus

检索指定报表类型的状态。
ILocation::RegisterForReport

请求位置报告事件。
ILocation::RequestPermissions

打开系统对话框,请求用户权限以启用位置设备。
ILocation::SetDesiredAccuracy

指定要使用的准确性。
ILocation::SetReportInterval

指定报告事件之间请求的最短时间量(以毫秒为单位)。
ILocation::UnregisterForReport

停止指定报表类型的事件通知。

注解

调用 CoCreateInstance 创建 ILocation 对象时,如果这是应用程序首次使用位置,则可能会导致任务栏中显示通知,并在事件查看器记录位置活动事件。

要求

要求
最低受支持的客户端 Windows 7 [仅限桌面应用]
最低受支持的服务器 无受支持的版本
目标平台 Windows
标头 locationapi.h