title: Is possible retrieve my exact location using the service geolocation of Windows 10?
body: <p>I want know if <a href="https://www.youtube.com/watch?v=r4cVAbXUm0Y" rel="nofollow noreferrer"><em>the service of geolocation present on Windows 10</em></a> is possible be used (by a application) without need install external drivers before (where on Windows 7 seem be mandatory install, based in article of <strong>@RRUZ</strong> reffered below) and if this service can to retrieve the exact location of a pc (like a precision of a GPS present in any smartphone).</p>
  
  <p>If yes, how i can capture the informations retrieved by the service of location programatically with a Delphi code? </p>
  
  <p>I saw in several sites about how i can discovery this exact location using a Delphi code (but i don't know if this is the right way to retrieve this information programatically in Win 7 ~ Win 10) and i found a <a href="https://theroadtodelphi.com/2012/09/29/exploring-delphi-xe3-accesing-windows-sensors-from-vcl-and-firemonkey-part-1/" rel="nofollow noreferrer">code</a> of <strong>@RRUZ</strong>. So relative to this code, i tested in Windows 7 x64 using a external driver called <a href="http://www.turboirc.com/gps7/" rel="nofollow noreferrer"><strong>GPSDirect</strong></a> and i also <a href="https://www.techsupportalert.com/content/how-enable-or-disable-location-sensing-windows-7-and-8.htm" rel="nofollow noreferrer"><em>enabled this driver via Control Panel</em></a> but when console app is executed is missing some informations:</p>
  
  <p><a href="https://i.stack.imgur.com/50vjR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/50vjR.png" alt="enter image description here"></a></p>
  
  <p><em>Code:</em></p>
  
  <pre><code>program geo;
  
  {$APPTYPE CONSOLE}
  
  {$R *.res}
  
  uses
    System.TypInfo,
    System.Sensors,
    System.SysUtils;
  
  procedure EnumerateSensors;
  var
    LManager : TSensorManager;
    LCustomLocationSensor          : TCustomLocationSensor;
    LCustomLightSensor             : TCustomLightSensor;
    LCustomEnvironmentalSensor     : TCustomEnvironmentalSensor;
    LCustomMotionSensor            : TCustomMotionSensor;
    LCustomOrientationSensor       : TCustomOrientationSensor;
    LCustomMechanicalSensor        : TCustomMechanicalSensor;
    LCustomElectricalSensor        : TCustomElectricalSensor;
    LCustomBiometricSensor         : TCustomBiometricSensor;
    LCustomScannerSensor           : TCustomScannerSensor;
    LSensor  : TCustomSensor;
    i        : Integer;
  begin
    LManager := TSensorManager.Current;
    LManager.Activate;
    //LSensors  := LManager.GetSensorsByCategory(TSensorCategory.Location);
    if LManager.Count &gt; 0 then
    for i := 0 to LManager.Count-1 do
    begin
      Writeln(Format('Sensor %d',[i+1]));
      Writeln('--------');
  
      LSensor:= LManager.Sensors[i];
      Writeln(Format('Category     : %s', [GetEnumName(TypeInfo(TSensorCategory),integer(LSensor.Category))]));
      Writeln(Format('Description  : %s', [LSensor.Description]));
      Writeln(Format('Manufacturer : %s', [LSensor.Manufacturer]));
      Writeln(Format('Model        : %s', [LSensor.Model]));
      Writeln(Format('Serial No    : %s', [LSensor.SerialNo]));
      Writeln(Format('State        : %s', [GetEnumName(TypeInfo(TSensorState),integer(LSensor.State))]));
      Writeln(Format('TimeStamp    : %s', [DatetoStr(LSensor.TimeStamp)]));
      Writeln(Format('Unique ID    : %s', [LSensor.UniqueID]));
  
      case LSensor.Category of
  
        TSensorCategory.Location :
        begin
          LCustomLocationSensor:=LSensor as TCustomLocationSensor;
          LCustomLocationSensor.Start;
          Writeln(Format('Sensor Type       : %s', [GetEnumName(TypeInfo(TLocationSensorType),integer(LCustomLocationSensor.SensorType))]));
          Writeln(Format('Authorized        : %s', [GetEnumName(TypeInfo(TAuthorizationType),integer(LCustomLocationSensor.Authorized))]));
          Writeln(Format('Accuracy          : %n', [LCustomLocationSensor.Accuracy]));
          Writeln(Format('Distance          : %n', [LCustomLocationSensor.Distance]));
          Writeln(Format('Power Consumption : %s', [GetEnumName(TypeInfo(TPowerConsumption),integer(LCustomLocationSensor.PowerConsumption))]));
          Writeln(Format('Location Change   : %s', [GetEnumName(TypeInfo(TLocationChangeType),integer(LCustomLocationSensor.LocationChange))]));
          Writeln(Format('Latitude          : %n', [LCustomLocationSensor.Latitude]));
          Writeln(Format('Longitude         : %n', [LCustomLocationSensor.Longitude]));
          Writeln(Format('Longitude         : %n', [LCustomLocationSensor.Longitude]));
          Writeln(Format('Error Radius      : %n', [LCustomLocationSensor.ErrorRadius]));
          Writeln(Format('Altitude          : %n', [LCustomLocationSensor.Altitude]));
          Writeln(Format('Speed             : %n', [LCustomLocationSensor.Speed]));
          Writeln(Format('True Heading      : %n', [LCustomLocationSensor.TrueHeading]));
          Writeln(Format('Magnetic Heading  : %n', [LCustomLocationSensor.MagneticHeading]));
          Writeln(Format('Address1          : %s', [LCustomLocationSensor.Address1]));
          Writeln(Format('Address2          : %s', [LCustomLocationSensor.Address2]));
          Writeln(Format('City              : %s', [LCustomLocationSensor.City]));
          Writeln(Format('State/Province    : %s', [LCustomLocationSensor.StateProvince]));
          Writeln(Format('Postal Code       : %s', [LCustomLocationSensor.PostalCode]));
          Writeln(Format('Country Region    : %s', [LCustomLocationSensor.CountryRegion]));
          LCustomLocationSensor.Stop;
        end;
  
        TSensorCategory.Light :
        begin
          LCustomLightSensor:=LSensor as TCustomLightSensor;
          Writeln(Format('Lux          : %n', [LCustomLightSensor.Lux]));
          Writeln(Format('Temperature  : %n', [LCustomLightSensor.Temperature]));
          Writeln(Format('Chromacity   : %n', [LCustomLightSensor.Chromacity]));
          Writeln(Format('Sensor Type  : %s', [GetEnumName(TypeInfo(TLightSensorType),integer(LCustomLightSensor.SensorType))]));
        end;
  
        TSensorCategory.Environmental :
        begin
          LCustomEnvironmentalSensor:= LSensor as TCustomEnvironmentalSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TEnvironmentalSensorType),integer(LCustomEnvironmentalSensor.SensorType))]));
          Writeln(Format('Temperature    : %n', [LCustomEnvironmentalSensor.Temperature]));
          Writeln(Format('Pressure       : %n', [LCustomEnvironmentalSensor.Pressure]));
          Writeln(Format('Humidity       : %n', [LCustomEnvironmentalSensor.Humidity]));
          Writeln(Format('Wind Direction : %n', [LCustomEnvironmentalSensor.WindDirection]));
          Writeln(Format('Wind Speed     : %n', [LCustomEnvironmentalSensor.WindSpeed]));
        end;
  
        TSensorCategory.Motion :
        begin
          LCustomMotionSensor:= LSensor as TCustomMotionSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TMotionSensorType),integer(LCustomMotionSensor.SensorType))]));
          Writeln(Format('Acceleration X : %n', [LCustomMotionSensor.AccelerationX]));
          Writeln(Format('Acceleration Y : %n', [LCustomMotionSensor.AccelerationY]));
          Writeln(Format('Acceleration Z : %n', [LCustomMotionSensor.AccelerationZ]));
          Writeln(Format('Angle Accel. X : %n', [LCustomMotionSensor.AngleAccelX]));
          Writeln(Format('Angle Accel. Y : %n', [LCustomMotionSensor.AngleAccelY]));
          Writeln(Format('Angle Accel. Z : %n', [LCustomMotionSensor.AngleAccelZ]));
          Writeln(Format('Motion         : %n', [LCustomMotionSensor.Motion]));
          Writeln(Format('Speed          : %n', [LCustomMotionSensor.Speed]));
          Writeln(Format('Update Interval: %n', [LCustomMotionSensor.UpdateInterval]));
        end;
  
        TSensorCategory.Orientation :
        begin
          LCustomOrientationSensor:= LSensor as TCustomOrientationSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TOrientationSensorType),integer(LCustomOrientationSensor.SensorType))]));
          Writeln(Format('Tilt X         : %n', [LCustomOrientationSensor.TiltX]));
          Writeln(Format('Tilt Y         : %n', [LCustomOrientationSensor.TiltY]));
          Writeln(Format('Tilt Z         : %n', [LCustomOrientationSensor.TiltZ]));
          Writeln(Format('Distance X     : %n', [LCustomOrientationSensor.DistanceX]));
          Writeln(Format('Distance Y     : %n', [LCustomOrientationSensor.DistanceY]));
          Writeln(Format('Distance Z     : %n', [LCustomOrientationSensor.DistanceZ]));
          Writeln(Format('Heading X      : %n', [LCustomOrientationSensor.HeadingX]));
          Writeln(Format('Heading Y      : %n', [LCustomOrientationSensor.HeadingY]));
          Writeln(Format('Heading Z      : %n', [LCustomOrientationSensor.HeadingZ]));
          Writeln(Format('Mag. Heading   : %n', [LCustomOrientationSensor.MagHeading]));
          Writeln(Format('True Heading   : %n', [LCustomOrientationSensor.TrueHeading]));
          Writeln(Format('Comp.Heading   : %n', [LCustomOrientationSensor.CompMagHeading]));
          Writeln(Format('Comp True Head : %n', [LCustomOrientationSensor.CompTrueHeading]));
        end;
  
        TSensorCategory.Mechanical :
        begin
          LCustomMechanicalSensor:= LSensor as TCustomMechanicalSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TMechanicalSensorType),integer(LCustomMechanicalSensor.SensorType))]));
          Writeln(Format('Switch State   : %s', [BoolToStr(LCustomMechanicalSensor.SwitchState, True)]));
          Writeln(Format('Switch Array State : %d', [LCustomMechanicalSensor.SwitchArrayState]));
          Writeln(Format('Multi Value State  : %n', [LCustomMechanicalSensor.MultiValueState]));
          Writeln(Format('Force              : %n', [LCustomMechanicalSensor.Force]));
          Writeln(Format('Abs. Pressure      : %n', [LCustomMechanicalSensor.AbsPressure]));
          Writeln(Format('Gauge Pressure     : %n', [LCustomMechanicalSensor.GaugePressure]));
          Writeln(Format('Strain             : %n', [LCustomMechanicalSensor.Strain]));
          Writeln(Format('Weight             : %n', [LCustomMechanicalSensor.Weight]));
        end;
  
        TSensorCategory.Electrical :
        begin
          LCustomElectricalSensor:= LSensor as TCustomElectricalSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TElectricalSensorType),integer(LCustomElectricalSensor.SensorType))]));
          Writeln(Format('Capacitance    : %n', [LCustomElectricalSensor.Capacitance]));
          Writeln(Format('Resistance     : %n', [LCustomElectricalSensor.Resistance]));
          Writeln(Format('Inductance     : %n', [LCustomElectricalSensor.Inductance]));
          Writeln(Format('Current        : %n', [LCustomElectricalSensor.Current]));
          Writeln(Format('Voltage        : %n', [LCustomElectricalSensor.Voltage]));
          Writeln(Format('Power          : %n', [LCustomElectricalSensor.Power]));
        end;
  
        TSensorCategory.Biometric :
        begin
          LCustomBiometricSensor:= LSensor as TCustomBiometricSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TBiometricSensorType),integer(LCustomBiometricSensor.SensorType))]));
          Writeln(Format('Human Proximity: %n', [LCustomBiometricSensor.HumanProximity]));
          Writeln(Format('Human Presense : %s', [BoolToStr(LCustomBiometricSensor.HumanPresense, True)]));
          Writeln(Format('Touch          : %s', [BoolToStr(LCustomBiometricSensor.Touch, True)]));
        end;
  
        TSensorCategory.Scanner :
        begin
          LCustomScannerSensor:= LSensor as TCustomScannerSensor;
          Writeln(Format('Sensor Type    : %s', [GetEnumName(TypeInfo(TScannerSensorType),integer(LCustomScannerSensor.SensorType))]));
          Writeln(Format('Human Proximity: %d', [LCustomScannerSensor.RFIDTag]));
          Writeln(Format('Barcode Data   : %s', [LCustomScannerSensor.BarcodeData]));
        end;
  
      end;
      Writeln;
    end
    else
     Writeln('Not sensors was found');
    LManager.Deactivate;
  end;
  
  begin
    try
      EnumerateSensors;
    except
      on E: Exception do
        Writeln(E.ClassName, ': ', E.Message);
    end;
    Readln;
  end.
  </code></pre>