GetProfString (SOLVED)

GetProfString (SOLVED)

Postby Bayron » Sat Feb 09, 2013 4:08 am

Hi all,

How can I get Windows Default Language using GetProfString???

Apparently the way of getting this setting is missing from testini2.prg since FWH2.4, causing it to crash...
Last edited by Bayron on Sat Feb 09, 2013 1:43 pm, edited 1 time in total.
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: GetProfString

Postby Euclides » Sat Feb 09, 2013 12:06 pm

Byron,
In some places, (like in Brazil) even in the FW 2.4 testini2.prg runs with error.
to fix it, place the line:
cMsg := csLanguage
after the line:
/* Which language is Windows set to USE ? */
Regards,
Euclides
User avatar
Euclides
 
Posts: 154
Joined: Wed Mar 28, 2007 1:19 pm

Re: GetProfString

Postby ukoenig » Sat Feb 09, 2013 12:20 pm

Bayron,

How can I get Windows Default Language

2 API-functions :

DLL32 FUNCTION GetUsDeLaI( );
AS _INT PASCAL;
FROM "GetUserDefaultLangID" LIB "KERNEL32"


DLL32 FUNCTION GetUsDeLCI( );
AS LONG PASCAL;
FROM "GetUserDefaultLCID" LIB "KERNEL32"


My Test :

MsgAlert( GetUsDeLaI( ) )
// RETURNS : 1031 = German (Standard)


The needed LANGUAGE-return ID's !!!

*!* List All Supported Languages and Their ID's

*!* Arabic (Saudi Arabia) 1025
*!* Arabic (Iraq) 2049
*!* Arabic (Egypt) 3073
*!* Arabic (Libya) 4097
*!* Arabic (Algeria) 5121
*!* Arabic (Morocco) 6145
*!* Arabic (Tunisia) 7169
*!* Arabic (Oman) 8193
*!* Arabic (Yemen) 9217
*!* Arabic (Syria) 10241
*!* Arabic (Jordan) 11265
*!* Arabic (Lebanon) 12289
*!* Arabic (Kuwait) 13313
*!* Arabic (U.A.E.) 14337
*!* Arabic (Bahrain) 15361
*!* Arabic (Qatar) 16385
*!* Bulgarian 1026
*!* Catalan 1027
*!* Chinese (Taiwan) 1028
*!* Chinese (PRC) 2052
*!* Chinese (Hong Kong SAR 3076
*!* Chinese (Singapore) 4100
*!* Czech 1029
*!* Danish 1030
*!* German (Standard) 1031
*!* German (Swiss) 2055
*!* German (Austrian) 3079
*!* German (Luxembourg) 4103
*!* German (Liechtenstein) 5127
*!* Greek 1032
*!* English (United States) 1033
*!* English (United Kingdom) 2057
*!* English (Australian) 3081
*!* English (Canadian) 4105
*!* English (New Zealand) 5129
*!* English (Ireland) 6153
*!* English (South Africa) 7177
*!* English (Jamaica) 8201
*!* English (Caribbean) 9225
*!* English (Belize) 10249
*!* English (Trinidad) 11273
*!* Spanish (Traditional Sort) 1034
*!* Spanish (Mexican) 2058
*!* Spanish (Modern Sort) 3082
*!* Spanish (Guatemala) 4106
*!* Spanish (Costa Rica) 5130
*!* Spanish (Panama) 6154
*!* Spanish (Dominican Republic) 7178
*!* Spanish (Venezuela) 8202
*!* Spanish (Colombia) 9226
*!* Spanish (Peru) 10250
*!* Spanish (Argentina) 11274
*!* Spanish (Ecuador) 12298
*!* Spanish (Chile) 13322
*!* Spanish (Uruguay) 14346
*!* Spanish (Paraguay) 15370
*!* Spanish (Bolivia) 16394
*!* Spanish (El Salvador) 17418
*!* Spanish (Honduras) 18442
*!* Spanish (Nicaragua) 19466
*!* Spanish (Puerto Rico) 20490
*!* Finnish 1035
*!* French (Standard) 1036
*!* French (Belgian) 2060
*!* French (Canadian) 3084
*!* French (Swiss) 4108
*!* French (Luxembourg) 5132
*!* Hebrew 1037
*!* Hungarian 1038
*!* Icelandic 1039
*!* Italian (Standard) 1040
*!* Italian (Swiss) 2064
*!* Japanese 1041
*!* Korean 1042
*!* Korean (Johab) 2066
*!* Dutch (Standard) 1043
*!* Dutch (Belgian) 2067
*!* Norwegian (Bokmal) 1044
*!* Norwegian (Nynorsk) 2068
*!* Polish 1045
*!* Portuguese (Brazil) 1046
*!* Portuguese (Portugal) 2070
*!* Romanian 1048
*!* Russian 1049
*!* Croatian 1050
*!* Serbian (Latin) 2074
*!* Serbian (Cyrillic) 3098
*!* Slovak 1051
*!* Albanian 1052
*!* Swedish 1053
*!* Swedish (Finland) 2077
*!* Thai 1054
*!* Turkish 1055
*!* Indonesian 1057
*!* Ukrainian 1058
*!* Belarusian 1059
*!* Slovenian 1060
*!* Estonian 1061
*!* Latvian 1062
*!* Lithuanian 1063
*!* Farsi 1065
*!* Vietnamese 1066
*!* Basque 1069
*!* Afrikaans 1078
*!* Faeroese 1080

*!* Declare GetUserDefaultLCID API Function

DECLARE LONG GetUserDefaultLCID IN WIN32API

*!* Get Language ID *****

?GetUserDefaultLCID()

NAME

GetUserDefaultLangID (KERNEL32.@)

SYNOPSIS
LANGID GetUserDefaultLangID
(
)

DESCRIPTION

Get the default language Id for the current user.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: GetProfString

Postby Bayron » Sat Feb 09, 2013 1:04 pm

Thanks for the help....
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: GetProfString

Postby ukoenig » Sat Feb 09, 2013 1:08 pm

Bayron,

do You still need to change the language from inside Your appl.

Best Regards
Uwe :?: i
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: GetProfString

Postby Bayron » Sat Feb 09, 2013 1:42 pm

The problem I had was, that csLanguage was returning ESG, wich is Spanish for Guatemala, so I changed

Code: Select all  Expand view
CASE csLanguage == "ESP" ; cMsg :="Castilian Spanish [esp]"
 


for

Code: Select all  Expand view
CASE csLanguage = "ES" ; cMsg :="Spanish"
 


and now everything is fine and dandy...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: GetProfString

Postby Bayron » Sat Feb 09, 2013 2:38 pm

ukoenig wrote:Bayron,

do You still need to change the language from inside Your appl.

Best Regards
Uwe :?: i


Hi Uwe,
I just needed to find out wich language was the Default in Windows, in case the user has not set up the Default language in my App...

Thanks...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 110 guests