如何打开或关闭输入法?
在DW的某一列得到焦点时,如何自动打开或关闭汉字输入法,以方便输入. 问题点数:20、回复次数:2Top
1 楼lesni(乐S你)回复于 2002-04-12 12:08:12 得分 20
先在Local extenal function定义下列API Function
function boolean ImmSimulateHotKey (UnsignedLong hWnd,UnsignedLong dwHotKeyID) library "IMM32.dll"
function unsignedlong GetKeyboardLayout (unsignedlong wLayout)library "user32.dll"
function boolean ImmIsIME(unsignedLong hklKeyboardLayout)library "IMM32.DLL"
在datawindow的itemchangedfocus event中:
ulong hklKeyboardLayout
Choose Case dwo.name
Case "chinese_text"
// 需要中文输入的字段
hklKeyboardLayout=GetKeyboardLayout(0)
if not ImmIsIME(hklKeyboardLayout) then
ImmSimulateHotKey(handle ( parent,112)
end if
Case "Englist_text"
// 英文输入字段
hklKeyboardLayout=GetKeyboardLayout(0)
if ImmIsIME(hklKeyboardLayout) then
ImmSimulateHotKey(handle ( parent ),112)
end if
End Choose
在windows 编辑框中类似。
Top
2 楼pborvb(高举PB伟大旗帜)回复于 2002-04-12 12:56:44 得分 0
呵呵,总是没有先搜索的习惯,刚才搜了一下,发现是老问题了,呵呵,结贴。Top




