對一些不能經由IMM API存取的輸入法提供支援能力的函數,傳回值若為 0 ,表示函數失敗
宣告
VB6
Private Declare Function ImmEscape Lib "imm32.dll" Alias "ImmEscapeA" ( _ ByVal hkl As Long, _ ByVal himc As Long, _ ByVal un As Long, _ lpv As Any) As Long參數
hkl Keyboard Layout Handle
himc Handle of Input Context 與目前選定輸入法相關聯的應用程式代碼,0 表示目前執行序
un IME Escapes
lpv uEscape 有些常數需要指定資料地址,若無則以 Null 代替
常數
IME_ESC_RESERVED_FIRST = &H4
The escape between IME_ESC_RESERVED_FIRST and IME_ESC_RESERVED_LAST is reserved by the system.
IME_ESC_RESERVED_LAST = &H7FF
The escape between IME_ESC_RESERVED_FIRST and IME_ESC_RESERVED_LAST is reserved by the system.
IME_ESC_GET_EUDC_DICTIONARY = &H1003
The escape is Chinese specific. An application that needs to run under all Asian platforms should not use it. It is for the Chinese EUDC editor. On return from the function, the lpData is filled with the full path file name of the EUDC dictionary. The size of the buffer pointed to by lpData should be greater or equal to 80 * sizeof(TCHAR).
IME_ESC_HANJA_MODE = &H1008
The escape is Korean specific. An application that needs to run under all Asian platforms should not use it. It is for conversion from Hangeul to Hanja. The input parameter lpData is filled with Hangeul character which will be converted to Hanja, and its null-terminated string. When the application needs to convert any Hangeul character to Hanja character in the same method of Hanja conversion with the composition character present, the application just requests this function and the IME sets itself as Hanja conversion mode.
IME_ESC_IME_NAME = &H1006
取得輸入法的名稱,失敗會傳回 0,成功則會將輸入法名稱放入指定的文字緩衝區內,這個緩衝區不能少於64個字元
IME_ESC_MAX_KEY = &H1005
我猜它的返回值應該是該輸入法的最大拆字碼數,我試了注音和大易輸入法,傳回值都是 4
IME_ESC_QUERY_SUPPORT = &H3
Checks for implementation. If this escape is not implemented, the return value is zero.
IME_ESC_SEQUENCE_TO_INTERNAL = &H1001
The escape is Chinese specific. An application that needs to run under all Asian platforms should not use it. It is for the Chinese EUDC editor. The lpData parameter is the sequence code, and the return value is the character code for this sequence code. Typically, the Chinese IME encodes its reading character codes into sequence 1 to n.
IME_ESC_SET_EUDC_DICTIONARY = &H1004
The escape is Chinese specific. An application that needs to run under all Asian platforms should not use it. It is for the Chinese EUDC editor. On return from the function, the lpData is the full path file name of the EUDC dictionary. The path name should be less than 80 * sizeof(TCHAR).
IME_ESC_PRIVATE_FIRST = &H800
The escape between IME_ESC_PRIVATE_FIRST and IME_ESC_PRIVATE_LAST is reserved for the IME. The IME can freely use these escape functions for its own purposes.
IME_ESC_PRIVATE_LAST = &HFFF
The escape between IME_ESC_PRIVATE_FIRST and IME_ESC_PRIVATE_LAST is reserved for the IME. The IME can freely use these escape functions for its own purposes
IME_ESC_SYNC_HOTKEY = &H1007
The escape is (Traditional) Chinese specific. An application that needs to run under all Asian platforms should not use it. It is to synchronize between different IMEs. The input parameter lpData is the IME private hot key ID. If this ID is zero, this IME should check every private hot key ID it concerns.
範例
Dim strBuf As String strBuf = Space(255) '大易 -536476668 '注音 -536804348 If ImmEscape(-536804348, 0, IME_ESC_IME_NAME, ByVal strBuf) <> 0 Then MsgBox strBuf End If顯示為 注音
沒有留言:
張貼留言