|
-
Jan 17th, 2015, 09:38 AM
#7
Re: [RESOLVED] How to get Unicode char on IME window in VB6?
Yes, there was a lot of discussion on this in Krool's Common Controls thread. A few different solutions were provided, but georgekar gave the simplest one - here is Krool's discussion of how he used georgekar's idea:
http://www.vbforums.com/showthread.p...=1#post4786597
WM_CHAR and WM_IME_CHAR are too late to recover the original Unicode character. You have to cache the value before WM_CHAR; otherwise VB's ANSI pump will eat it. (Between the WM_KEYDOWN/WM_IME_KEYDOWN events, and the WM_CHAR/WM_IME_CHAR events, VB's parent window gets a chance to preview the key data, so it can look for accelerator keypresses. That preview is what ruins Unicode data, because VB uses TranslateMessageA.)
I think georgekar's solution could also be used for the IME window, but in the WM_IME_KEYDOWN event instead of WM_KEYDOWN. Use PeekMessage in the same way, to see the correct Unicode character value in WM_IME_KEYDOWN. Cache this value, then later, when WM_IME_CHAR happens, you can use the cached value to obtain the correct Unicode value, since you intercepted it before VB's ANSI message pump ruined it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|