ImmGetProperty 对应的常量含义

       输入法编程之所以入门很麻烦,一个很重要的原因就是MSDN 对其解释的太简略 有的函数 常量  甚至很难去寻找是何含义,必须靠运气查找N多资料,然后进行整合。
        对于不少常量直接在MSDN中输入是查不到的,必须幸运的找到使用这个常量的函数才可以。

ImmGetProperty

 

此函数有很多常量定义,其作用是:

This function gets the property and capabilities of the IME associated with the specified keyboard layout.

 

BOOL ImmGetProperty(
  HKL hKL, 
  DWORD fdwIndex 
);


 

hKL
[in] Ignored; set to NULL. Windows CE does not support true keyboard layouts.
fdwIndex
[in] Value that specifies the type of property information to retrieve. The following table shows the values this parameter can be.
ValueDescription
IGP_PROPERTYProperty information.
IGP_CONVERSIONConversion capabilities.
IGP_SENTENCESentence mode capabilities.
IGP_UIUser interface capabilities.
IGP_SETCOMPSTRComposition string capabilities.
IGP_SELECTSelection inheritance capabilities.
Return Values

Returns the property or capability value, depending on the value of the dwIndex parameter. If dwIndex is IGP_PROPERTY, ImmGetProperty returns a combination of the following values:

IME_PROP_AT_CARET
If set, conversion window is at the caret position. If clear, the window is near caret position.
IME_PROP_SPECIAL_UI
If set, IME has a nonstandard user interface. The application should not draw in the IME window.
IME_PROP_CANDLIST_START_FROM_1
If set, strings in the candidate list are numbered starting at 1. If clear, strings start at zero.
IME_PROP_UNICODE
If set, strings for the input context have Unicode characters. If clear, strings have single and double-byte characters.
IME_PROP_COMPLETE_ON_UNSELECT
If set, the IME will complete the composition string when the IME is deactivated. If clear, the IME will cancel the composition string when the IME is deactivated (such as from a keyboard layout change).

If dwIndex is IGP_UI, the return value is a combination of the values shown in the following table.

ValueDescription
UI_CAP_2700Supports text escapement values of 0 or 2700.
UI_CAP_ROT90Supports text escapement values of 0, 900, 1800, or 2700.
UI_CAP_ROTANYSupports any text escapement value.

If dwIndex is IGP_SETCOMPSTR, the return value is a combination of the values shown in teh following table.

ValueDescription
SCS_CAP_COMPSTRCan create the composition string by using the SCS_SETSTR value of the ImmSetCompositionString function.
SCS_CAP_MAKEREADCan create the reading string from corresponding composition string when using the SCS_SETSTR value of the ImmSetCompositionString function.

If dwIndex is IGP_SELECT, the return value is a combination of the values shown in the following table.

ValueDescription
SELECT_CAP_CONVMODEInherits conversion mode when a new IME is selected.
SELECT_CAP_SENTENCEInherits sentence mode when a new IME is selected.

If dwIndex is IGP_GETIMEVERSION, the return value is one of the values shown in the following table.

ValueDescription
IMEVER_0310The IME was created for Windows 3.1
IMEVER_0400The IME was created for Windows 95.

 

E文比较准确 但难懂,下面是百科上某位达人翻译过来的 ,感觉很好

 

 

ImmGetProperty

  简介:取得输入法的属性(特性)。MSDN: The ImmGetProperty function retrieves the property and capabilities of the IME associated with the specified input locale.

  原形:DWORD ImmGetProperty(HKL hKL, DWORD fdwIndex);

  hKL:输入法的HKL。

  fdwIndex:返回哪种属性。是这些值:

  [ -4]IGP_GETIMEVERSION:输入法接口所使用的版本。MSDN: Retrieves the system version number for which the specified IME was created.

  [0x04]IGP_PROPERTY:输入属性。MSDN: Property information.

  [0x08]IGP_CONVERSION:组字属性。MSDN: Conversion capabilities.

  [0x0C]IGP_SENTENCE:组句属性。MSDN: Sentence mode capabilities.

  [0x10]IGP_UI:用户界面(主要是文本旋转特性)。MSDN: User interface capabilities.

  [0x14]IGP_SETCOMPSTR:设置组字串的能力。MSDN: Composition string capabilities.

  [0x18]IGP_SELECT:切换输入法的继承特性。MSDN: Selection inheritance capabilities.

  返回值:该输入法属性。根据fdwIndex所填的常数而返回不同的属性:

  IGP_GETIMEVERSION:

  [0x0003000A]IMEVER_0310:该输入法基于 Windows 3.1。MSDN: The IME was created for Windows 3.1

  [0x00040000]IMEVER_0400:该输入法基于 Windows 9X(不要奇怪,现在WinXP改用TSF了)。MSDN: The IME was created for Windows 95/98/Me.

  IGP_PROPERTY:

  [0x00010000]IME_PROP_AT_CARET:组字窗口在插入符(caret,文本光标所在位置)附近(如微软拼音、紫光拼音)。MSDN: If set, conversion window is at the caret position. If clear, the window is near caret position.

  [0x00020000]IME_PROP_SPECIAL_UI:该输入法有自己的特殊窗口(如微软拼音、紫光拼音),应用程序不能自己绘制输入法窗口。MSDN: If set, IME has a nonstandard user interface. The application should not draw in the IME window.

  [0x00040000]IME_PROP_CANDLIST_START_FROM_1:(使用时)候选窗口中的列表是从1开始编号的。MSDN: If set, strings in the candidate list are numbered starting at 1. If clear, strings start at 0.

  [0x00080000]IME_PROP_UNICODE:该输入法是支持Unicode的。MSDN: If set, the IME is viewed as a Unicode IME. The system and the IME will communicate through the Unicode IME interface. If clear, IME will use the ANSI interface to communicate with the system.

  [0x00100000]IME_PROP_COMPLETE_ON_UNSELECT:当窗口失去焦点时,也将当前输入字符串提交。MSDN: Windows 98/Me, Windows 2000/XP: If set, the IME will complete the composition string when the IME is deactivated. If clear, the IME will cancel the composition string when the IME is deactivated (for example, from a keyboard layout change).

  [0x00000020]IME_PROP_ACCEPT_WIDE_VKEY:输入法发送Unicode字符数据是用SendInput发送VK_PACKET。MSDN: Windows 2000/XP: If set, the IME processes the injected Unicode that came from the SendInput function by using VK_PACKET. If clear, the IME might not process the injected Unicode, and the injected Unicode might be sent to the application directly.

  IGP_CONVERSION:

  [0x0000]IME_CMODE_ALPHANUMERIC:英文字母和数字输入。

  [0x0001]IME_CMODE_NATIVE:本地语言输入。MSDN: Set to 1 if NATIVE mode; 0 if ALPHANUMERIC mode.

  [0x0002]IME_CMODE_KATAKANA:[日]片假名。MSDN: Set to 1 if KATAKANA mode; 0 if HIRAGANA mode.

  [0x0003]IME_CMODE_LANGUAGE:???。

  [0x0008]IME_CMODE_FULLSHAPE:全角/半角。MSDN: Set to 1 if full shape mode; 0 if half shape mode.

  [0x0010]IME_CMODE_ROMAN:[日?]罗马?。MSDN: Set to 1 if ROMAN input mode; 0 if not.

  [0x0020]IME_CMODE_CHARCODE:直接输入字符内码?MSDN: Set to 1 if character code input mode; 0 if not.

  [0x0040]IME_CMODE_HANJACONVERT:[韩]汉字字符模式。MSDN: Set to 1 if HANJA convert mode; 0 if not.

  [0x0080]IME_CMODE_SOFTKBD:软键盘。MSDN: Set to 1 if Soft Keyboard mode; 0 if not.

  [0x0100]IME_CMODE_NOCONVERSION:不转换。MSDN: Set to 1 to prevent processing of conversions by IME; 0 if not.

  [0x0200]IME_CMODE_EUDC:用户自定义字符。MSDN: Set to 1 if EUDC conversion mode; 0 if not.

  [0x0400]IME_CMODE_SYMBOL:中文标点。MSDN: Set to 1 if SYMBOL conversion mode; 0 if not.

  [0x0800]IME_CMODE_FIXED:???MSDN: Windows 98/Me, Windows 2000/XP: Set to 1 if fixed conversion mode; 0 if not.

  IGP_SENTENCE:

  [0x0000]IME_SMODE_NONE:没有组句信息。MSDN: No information for sentence.

  [0x0001]IME_SMODE_PLAURALCLAUSE:有多个子句信息。MSDN: The IME uses plural clause information to carry out conversion processing.

  [0x0002]IME_SMODE_SINGLECONVERT:单字符模式。MSDN: The IME carries out conversion processing in single-character mode.

  [0x0004]IME_SMODE_AUTOMATIC:自动模式。MSDN: The IME carries out conversion processing in automatic mode.

  [0x0008]IME_SMODE_PHRASEPREDICT:词语联想。MSDN: The IME uses phrase information to predict the next character.

  [0x0010]IME_SMODE_CONVERSATION:逐键提示。MSDN: The IME uses conversation mode. This is useful for chat applications.

  IGP_UI:

  [0x00000001]UI_CAP_2700:支持0度和270度排版(中文竖行排版)。MSDN: Supports text escapement values of 0 or 2700. For more information, see the lfEscapement member of the LOGFONT structure.

  [0x00000002]UI_CAP_ROT90:支持所有90度排版。MSDN: Supports text escapement values of 0, 900, 1800, or 2700. For more information, see lfEscapement.

  [0x00000004]UI_CAP_ROTANY:支持任意角度排版。MSDN: Supports any text escapement value. For more information, see lfEscapement.

  IGP_SETCOMPSTR:

  [0x00000001]SCS_CAP_COMPSTR:能够调用ImmSetCompositionString设置组字串。MSDN: Can create the composition string by calling the ImmSetCompositionString function with the SCS_SETSTR value.

  [0x00000002]SCS_CAP_MAKEREAD:能够修改输入串。MSDN: Can create the reading string from corresponding composition string when using the ImmSetCompositionString function with SCS_SETSTR and without setting lpRead.

  [0x00000004]SCS_CAP_SETRECONVERTSTRING:能够使用SCS_SETRECONVERTSTRING常数。MSDN: This IME can support reconversion. Use ImmSetCompositionString to do reconversion.

  IGP_SELECT:

  [0x00000001]SELECT_CAP_CONVERSION:能够继承组字属性。MSDN: Inherits conversion mode when a new IME is selected.

  [0x00000002]SELECT_CAP_SENTENCE:能够继承组句属性。MSDN: Inherits sentence mode when a new IME is selected.

 

 

参考资料:

 

http://baike.baidu.com/view/3137313.htm

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值