這三個(gè)函數(shù)都是得到語(yǔ)言ID,但是使用的場(chǎng)合上卻是有所不同,下面先給出三個(gè)函數(shù)的原型和解釋:
GetUserDefaultLangID
Returns the language identifier for the current user locale.
LANGID GetUserDefaultLangID(void);
Parameters
This function has no parameters.
Return Values
Returns the language identifier for the current user locale.
GetSystemDefaultLangID
Returns the language identifier for the system locale.
LANGID GetSystemDefaultLangID(void);
Parameters
This function has no parameters.
Return Values
Returns the language identifier for the system locale.
GetUserDefaultUILanguage
Retrieves the user UI language for the current user. If the current user has not set a language, GetUserDefaultUILanguage returns the language identifier for the system default UI language.
LANGID GetUserDefaultUILanguage(void);
Parameters
This function has no parameters.
Return Value
Returns the language identifier for the user UI language for the current user.
要理解這三個(gè)函數(shù)的使用先要看看控制面板->區(qū)域和語(yǔ)言選項(xiàng),
第一頁(yè)代表數(shù)字貨幣時(shí)間,第二頁(yè)是系統(tǒng)UI和軟件界面,第三頁(yè)高級(jí)是非unicode程序界面語(yǔ)言。
下面是這三個(gè)頁(yè)面設(shè)置時(shí),不同的函數(shù)的結(jié)果:
區(qū)域選項(xiàng) 語(yǔ)言 高級(jí)
GetUserDefaultLangID 改變 不變 不變
GetSystemDefaultLangID 不變 不變 改變
GetUserDefaultUILanguage 改變 改變 不變
由些可見,GetUserDefaultUILanguage會(huì)和系統(tǒng)UI的語(yǔ)言一致,所以我們建議在寫UNICODE程序界面時(shí)用這個(gè)
函數(shù)會(huì)好些,和OS的UI一致,不會(huì)讓客人覺(jué)得很奇怪。
本文來(lái)自CSDN博客,轉(zhuǎn)載請(qǐng)標(biāo)明出處:http://blog.csdn.net/nanjian011/archive/2009/10/23/4716903.aspx