Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 09-14-2016, 08:45 AM
Badger Badger is offline
Member
 
Join Date: Aug 2013
Location: Sheffield, Tasmania (Aust)
Posts: 76
Default Finding what units Windows is using

I need to find out whether the current user has set inches or metric as the default value in their system settings panel.

Can this be done and, if so, how?

Badger
  #2  
Old 09-24-2016, 07:08 AM
Badger Badger is offline
Member
 
Join Date: Aug 2013
Location: Sheffield, Tasmania (Aust)
Posts: 76
Default

I've solved this one by myself. For anyone interested the answer is in the code below.

Badger

Code:
var
  L: array [0..1] of Char;
const
  LOCALE_NAME_SYSTEM_DEFAULT = '!x-sys-default-locale';
begin
  Win32Check(GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_IMEASURE, @L, 2) <> 0);
  if L[0] = '0' then
  begin
     //'System is metric';
  end
  else
  begin
    //'System is US';
   
  end;
end;
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:37 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.