我要调用的是软键盘,输入法我会调。
另外问一下ImmCreateSoftKeyboard怎么声明呀?
另外问一下ImmCreateSoftKeyboard怎么声明呀?
解决方案 »
- DataList控件怎么设置可以多选 并且有checkbox. listbox有style设置就可以了
- 我这个程序哪里错了???
- 求助!有关SOCKET编程!给100分
- 如何在vb中判断服务器器的asp页面因为iis出错不能打开
- 旧的工程,怎么把控件加上去?
- 怎样把msflexgrid的某一列隐藏?
- 这里有中专生或高职生吗?我们组织个联盟吧~~
- 如何用VB编写一个接受EMAIL的程序并接收附件,将其附件另存至一目录。
- 如何用WINSOCK发送一个任意大的文件?
- 我问的不清楚吗? 大家说句话呀。没人帮,真痛苦。
- 一個字符串和另一個字符串連結,想得到這樣的結果如何做?
- Cooly(☆给我一个开心的理由!☆) 请您接分(1000之700),谢谢您解答我的问题.
1. The IME may need to create a better user interface for a soft keyboard, or it may need to use the system predefined soft keyboard. If IME needs to use the system predefined soft keyboard, it needs to specify UI_CAP_SOFTKBD in the fdwUICaps member of the IMEINFO structure when calling ImeInquire. 2. The IME can call ImmCreateSoftKeyboard to create a window for the soft keyboard, and it can call ImmShowSoftKeyboard to show or hide it. The soft keyboard window is one component of the UI window, so the owner should be the UI window. 3. The IME may need to decide whether to destroy the window whenever the focus is gone. The soft keyboard may occupy some system resources. 4. There are different types of soft keyboard. One type may be designed for a specific country or for a special purpose. The way to change reading characters may be different for each type of soft keyboard. There are two ways to change reading characters: use IMC_SETSOFKBDSUBTYPE or IMC_SETSOFKBDDATA. Different types of soft keyboards have different window procedures and present different user interfaces to the user. --from msdn
(ByVal nBuff As Long, lpList As Long) As Long
Private Declare Function ImmGetDescription Lib "imm32.dll" _
Alias "ImmGetDescriptionA" (ByVal hkl As Long, _
ByVal lpsz As String, ByVal uBufLen As Long) As Long
Private Declare Function ImmIsIME Lib "imm32.dll" (ByVal hkl As Long) As Long
Private Declare Function ActivateKeyboardLayout Lib "user32" _
(ByVal hkl As Long, ByVal flags As Long) As Long
Private Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Private Declare Function GetKeyboardLayoutName Lib "user32" Alias _
"GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Private Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" _
(ByVal pwszKLID As String, ByVal flags As Long) As Long
Const KLF_REORDER = &H8
Private NoOfKBDLayout As Long, i As Long, j As Long
Private hKB(24) As Long, BuffLen As Long
Private Buff As String
Private RetStr As String
Private RetCount As Long
Private kln As String
Private Sub Command1_Click()
If Combo1.ListIndex = -1 Then '如果用户尚未选择输入法,显示出错信息
MsgBox "请先选择一个输入法"
Exit Sub
End If
'改变输入法顺序
kln = String(8, 0)
ActivateKeyboardLayout hKB(Combo1.ListIndex), 0
res = GetKeyboardLayoutName(kln)
res = LoadKeyboardLayout(kln, KLF_REORDER)
ActivateKeyboardLayout hCurKBDLayout, 0
End Sub
Private Sub Form_Load()
Buff = String(255, 0)
hCurKBDLayout = GetKeyboardLayout(0) '取得目前的输入法
NoOfKBDLayout = GetKeyboardLayoutList(25, hKB(0)) '取得所有输入法
'ReDim layoutlist(NoOfKBDLayout) As String
For i = 1 To NoOfKBDLayout
If ImmIsIME(hKB(i - 1)) = 1 Then '中文输入法
BuffLen = 255
RetCount = ImmGetDescription(hKB(i - 1), Buff, BuffLen)
RetStr = Left(Buff, RetCount)
Combo1.AddItem RetStr
Else
RetStr = "English (American)" '英文输入法
Combo1.AddItem RetStr
End If
Next
ActivateKeyboardLayout hCurKBDLayout, 0 '恢复原来的输入法
End Sub------------------------------------------------------------C的声明是:
BOOL WINAPI ImmShowSoftKeyboard( //显示或隐藏软键盘
HWND hSoftKbdWnd //软年盘窗口句柄
int nCmdShow //窗口状态=SW_HIDE 表示隐藏,=SW_SHOWNOACTIVATE表示显示
)如构成功返回 TRUE. 否则为 FALSE.VB的声明是:
Private Declare Function ImmShowSoftKeyboard Lib "imm32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long