﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-酸菜猪蹄的程序人生-随笔分类-WIN32</title><link>http://www.cnitblog.com/cooleaf/category/6329.html</link><description>木下编程</description><language>zh-cn</language><lastBuildDate>Tue, 11 Oct 2011 15:00:44 GMT</lastBuildDate><pubDate>Tue, 11 Oct 2011 15:00:44 GMT</pubDate><ttl>60</ttl><item><title>在应用程序中禁止输入法工具栏</title><link>http://www.cnitblog.com/cooleaf/archive/2008/01/27/39367.html</link><dc:creator>cooleaf</dc:creator><author>cooleaf</author><pubDate>Sun, 27 Jan 2008 08:45:00 GMT</pubDate><guid>http://www.cnitblog.com/cooleaf/archive/2008/01/27/39367.html</guid><wfw:comment>http://www.cnitblog.com/cooleaf/comments/39367.html</wfw:comment><comments>http://www.cnitblog.com/cooleaf/archive/2008/01/27/39367.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/cooleaf/comments/commentRss/39367.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/cooleaf/services/trackbacks/39367.html</trackback:ping><description><![CDATA[<blockquote> <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:253c4036-ff4f-41bf-aeee-a2a48305bd85" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati 标签: <a href="http://technorati.com/tags/%e8%be%93%e5%85%a5%e6%b3%95%20%e7%a6%81%e6%ad%a2%20IME%20Disable" rel="tag">输入法 禁止 IME Disable</a></div> <p>和一个朋友聊天谈起，说起他们项目的一个需求，应用程序中不想弹出输入法窗口。结果一搜就搜到了，微软的支持站点就有。特此摘录下来，已备将来需要。</p> <h3>How to disable IME for a particular window</h3> <p>In the East Asian versions of Windows 95 and Windows NT 4.0, applications can call ImmAssociateContext() to disable IME for a certain window. Windows 95 and Windows 4.0 now have a new East Asian Common API Specification that enables this to would work for the Chinese, Japanese, and Korean versions of Windows 95 and Windows NT 4.0.  <h5>Sample code</h5>To disable IME for a certain window, an application can call ImmAssociateContext() API as shown below: <code> <table cellspacing="0" cellpadding="2" width="454" border="1"> <tbody> <tr> <td valign="top" width="452"><font color="#0000ff">HIMC</font> hIMC; <br>hIMC = <font color="#800040">ImmAssociateContext</font>(hWnd, NULL); <br><font color="#008040">// It makes IME disable for hWnd window. <br>// Then you can do whatever you want without IME.</font> <br><br><font color="#800040">ImmAssociateContext</font>(hWnd, hIMC); <br><font color="#008040">// If you want to enable IME again, <br>//then you can use the previous stored IME <br>// context(hIMC) to restore IME. <br></font></td></tr></tbody></table> <p></code>This method will not work on Windows 3.1 and Windows NT 3.5. You can use WinnlsEnableIME()for these systems, but this function will enable/disable the whole system IME, not just for a specific window. <br>The reason ImmAssociateContext() does not work on Windows NT 3.51 is that when Microsoft was developing new IMM functions, Windows NT 3.51 was already released with old functionality. Windows NT 3.5 and 3.51 still use Windows 3.1 style IME API like WinnlsEnableIME and SendIMEMessageEx. But, Windows NT 4.0 adapted Windows 95's IME API so that Windows NT 4.0 has the same set of IME API with Windows 95. </p></blockquote> <blockquote> <p>希望能给阅读此文的朋友带来帮助。</p></blockquote><img src ="http://www.cnitblog.com/cooleaf/aggbug/39367.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/cooleaf/" target="_blank">cooleaf</a> 2008-01-27 16:45 <a href="http://www.cnitblog.com/cooleaf/archive/2008/01/27/39367.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>