Board index » cppbuilder » Relating Registry to Windows Dialogs ...

Relating Registry to Windows Dialogs ...


2005-06-12 04:50:53 AM
cppbuilder77
Hi,
One of my applications need speciffic code-page to be set
in: Control Panel / Regional and Language ... / Advanced
for propper application functioning...
I have found that the entry I mentiond is related to the Registry
entry (XP):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language\Default
Name: Default, Type: REG_SZ, Data: [I read this to check if it is valid]
Is there some function (al)ready to check this without working
with registry directly?
--
Best regards,
Vladimir Stefanovic
 
 

Re:Relating Registry to Windows Dialogs ...

Vladimir Stefanovic wrote:
Quote
Hi,

One of my applications need speciffic code-page to be set
in: Control Panel / Regional and Language ... / Advanced
for propper application functioning...

I have found that the entry I mentiond is related to the Registry
entry (XP):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language\Default
Name: Default, Type: REG_SZ, Data: [I read this to check if it is valid]

Is there some function (al)ready to check this without working
with registry directly?
What you seek is in fact this:
std::string GetSysLanguage(void) {
char buffer[5] = {};
int ret = ::GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,
LOCALE_IDEFAULTLANGUAGE , buffer, 5);
return std::string(buffer);
}
Darko
 

Re:Relating Registry to Windows Dialogs ...

Darko wrote:
Quote
What you seek is in fact this:

std::string GetSysLanguage(void) {
char buffer[5] = {};
int ret = ::GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,
LOCALE_IDEFAULTLANGUAGE , buffer, 5);
return std::string(buffer);
}
I have tested the code and it works exactly as I needed.
Nice to have a compatriot somewhere around ;)
--
Best regards,
Vladimir Stefanovic
 

{smallsort}