如何切换中英文输入法及全角/半角?(原创)

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

如何切换中英文输入法全角/半角

问题描述:

如何切换中英文输入法全角/半角、中英文字符等?

解决方案:

一、声明外部函数:

 

functionbooleanImmSimulateHotKey(UnsignedLonghWnd,UnsignedLongdwHotKeyID)library"IMM32.dll"

functionunsignedlongGetKeyboardLayout(unsignedlongwLayout)library"user32.dll"

functionbooleanImmIsIME(unsignedLonghklKeyboardLayout)library"IMM32.DLL"

 

 

二、在一个按钮里写:

 

longll_hwnd

 

ll_hwnd=handle(sle_1)

IfnotImmIsIME(GetKeyboardLayout(0))Then

  ImmSimulateHotKey(ll_hwnd,16)

EndIf

 

ImmSimulateHotKey(ll_hwnd,17)

 

三、测试:运行后在TEXT中先输入逗号,均为半角,再点按钮后再输入逗号,均为全角
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: 数据库
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭