On my system, I get this from your program:
LangID = SYS: 0x40d, USR: 0x409
LCID = SYS: 0x40d, USR: 0x409
GetUserDefaultUILanguage() = 0409
GetSystemDefaultUILanguage = 0409
This is Windows XP SP2, with the following Regional Settings:
. In the Regional Options tab:
. In "Standard and formats": English (United States)
. In "Location": Israel
. In the Languages tab:
. Clicking on Details shows:
. In the Settings tab:
. Default input language: English (United States) - US
. In the Advanced tab:
. Every check box is unchecked
. In the Advanced tab:
. Language for non-Unicode programs: Hebrew