Answered Reading registry key

Hi everyone,

I'm trying to make my app more user friendly. And for this I need to matche the time format of the user like "HH:MM:SS" on 24h for Europeen and "HH:MM:SS AM/PM" for English type.

For this I tried to read a specific registry key. For this I found the following kb:

And so I write this:
Code:
DEF VAR DATA AS CHARACTER NO-UNDO.
LOAD "SOFTWARE" BASE-KEY "HKEY_CURRENT_USER".
USE "SOFTWARE".

GET-KEY-VALUE SECTION "Control Panel\International"
KEY "LocaleName"
VALUE DATA.   

UNLOAD "SOFTWARE".

MESSAGE DATA
    VIEW-AS ALERT-BOX INFO BUTTONS OK

But it's only returning the default value "?"

Did I don't understand the way of doing it ? Did I miss something ?
Are you able to do it ?

Best-Regards,

BobyIsProgress
 
Hi,

I found the solution. I was loading "SOFTWARE" that is a child of HKLM so I load "Control Panel" and it works very well.

Code:
DEF VAR DATA AS CHARACTER NO-UNDO.
LOAD "Control Panel" BASE-KEY "HKEY_CURRENT_USER".
USE "Control Panel".

GET-KEY-VALUE SECTION "International"
KEY "LocaleName"
VALUE DATA.   

UNLOAD "Control Panel".

MESSAGE DATA
    VIEW-AS ALERT-BOX INFO BUTTONS OK.

Best Regards,

- BobyIsProgress -
 
Top