如何在Windows上实现带重音符号的字符

如何在Windows上实现带重音符号的字符

本文介绍了如何在Windows上实现带重音符号的字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何有关在Windows上如何实现重音符号的指针都会有所帮助.

目标-能够使用ctrl +''之类的击键,后跟元音和在标准应用程序(例如MS Word,文本键盘等)上使用的所有其他组合来添加重音字符(áéíóú).

到目前为止的发现-我到处都可以阅读与WM_DEADCHAR消息相关的文档/博客/论坛.我理解的是::: TranslateMessage将与死键对应的WM_KEYUP消息转换为WM_DEADCHAR消息,并将由死键生成的WM_SYSKEYUP消息转换为WM_SYSDEADCHAR消息. Windows提供了将这些消息与字符消息结合以产生重音字符的逻辑,因此通常传递死键消息以进行默认处理.

我将此消息添加到我的CWnd派生类的消息映射中,但从未调用OnDeadChar().另外,我发现使用SPY ++甚至在MSWord,Textpad等中也可以结合使用这些击键来添加重音字符,但从不发送WM_DEADCHAR消息.那么,这是否意味着WM_DEADCHAR实际上不是解决此问题的方法?

请提供任何示例代码/步骤/机制来实现带重音符号.

在此先感谢!!!

Any pointers on how accented characters are implemented on Windows would be helpful.

Goal - Ability to add accented characters(áéíóú) using keystrokes like ctrl + '' followed by a vowel and all other combinations that work on standard applications like MS Word, Text pad etc.

My Findings till date - Everywhere I could read documentation/blogs/forums related to WM_DEADCHAR message.What I understand is : ::TranslateMessage translates WM_KEYUP messages corresponding to dead keys into WM_DEADCHAR messages, and it translates WM_SYSKEYUP messages generated by dead keys into WM_SYSDEADCHAR messages. Windows provides the logic that combines these messages with character messages to produce accented characters, so dead-key messages are usually passed on for default processing.

I added this message to my CWnd derived class''s message map but OnDeadChar() never gets called. Additionally I have found out using SPY++ that even in MSWord,Textpad etc where accented characters could be added with combination of these keystrokes, WM_DEADCHAR message is never dispatched. So, Does this mean that WM_DEADCHAR is actually not the way to address this issue?

Please provide any sample code/steps/mechanism to implement accented characters.

Thanks in advance!!!

推荐答案


这篇关于如何在Windows上实现带重音符号的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 02:49