永远也不完美的程序

不断学习,不断实践,不断的重构……

常用链接

统计

积分与排名

好友链接

最新评论

接收不到IME消息的问题和解决方法

        上次写了一个UI的控件editbox,我采用了IME响应中文输入,但在消息处理的时候收到WM_INPUTLANGCHANGEREQUEST,却没收到WM_INPUTLANGCHANGE的消息,在网上也查不到原因,看MSDN一开始也没看出原因。但实际上是我自己没能理解MSDN所说的。
The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.
        实际上这段话的意思是,收到了WM_INPUTLANGCHANGEREQUEST后,要把该消息发送给DefWindowProc才能收到输入法的改变消息。
我原来的代码是:
BOOL WndProc()
{
    switch (msg)
    {
   
    }
    return 0;
}

后来改为:
BOOL WndProc()
{
    switch (msg)
    {
   
    }
    return DefWindowProc(......);
}
 就没问题了!所以一定要充分理解MSDN所说的。

posted on 2009-11-08 21:23 狂烂球 阅读(2764) 评论(1)  编辑 收藏 引用 所属分类: Windows编程

评论

# re: 接收不到IME消息的问题和解决方法 2011-04-29 10:04 designer handbags

不错不错, 谢谢分享  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理