Kr00l / VBCCR

VB Common Controls Replacement Library
MIT License
104 stars 46 forks source link

No issue, but a question about IME handling #6

Closed TimoKunze closed 5 years ago

TimoKunze commented 5 years ago

Hi,

I've found out that the following code makes the Windows 10 emoji IME work correctly with these controls in VB6 apps:

Case WM_IME_CHAR
        SendMessage hWnd, WM_CHAR, wParam, ByVal lParam
        Exit Function

But in the code I can see a lot more special handling, e.g. the ComCtlsPeekCharCode stuff. Can you tell me when this extra code is necessary? I have deactivated it and so far cannot see any difference.

Awesome work by the way. 👍

Best regards

Kr00l commented 5 years ago

In WM_KEYDOWN the ComCtlsPeekCharCode is used to cache the unicode char code for the upcoming WM_CHAR. Then later the cached char code is used in the WM_CHAR handler to replace the char code. Reason for this replace is because the VB6 ANSI message bump might ANSIfy the char code for WM_CHAR. With the cache this is circumvented.