Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Win32 Native(api or anything) to read current machine Geolocation?

Did anyone manage to read a Windows machine's longtitude & latitude (GPS Position), without using .Net 4 libraries (Windows.Devices namespace) nor Javascript or other webbish code ?

There must be a native way. The location sensor is in the Control Panel,

I could not find any API nor valid documentation which allows me to read off of it, I would like to avoid having Net framework 4.0 as a dependency and invoking a browser process in the background, just to read current user's location via javascript is a huge overhead in my opinion

like image 550
Stavm Avatar asked Apr 03 '16 14:04

Stavm


People also ask

Which function is used to get the current position using Geolocation API?

The Geolocation. getCurrentPosition() method is used to get the current position of the device.

What is HTML Geolocation API?

The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise privacy, the position is not available unless the user approves it. Try It. Note: Geolocation is most accurate for devices with GPS, like smartphones.


1 Answers

The native Win32 API is the Sensor API. The Sensor API Programming Guide has some fairly detailed C++ examples.

Good article: Using Windows 7 Location API

(Google the above terms if the links ever break).

like image 175
2 revs, 2 users 80% Avatar answered Sep 27 '22 17:09

2 revs, 2 users 80%