I have written a DLL which exports a function that creates a window using RegisterClassExW and CreateWindowExW. Every message is retrieved via
GetMessageW(&msg, wnd_handle, 0, 0);
TranslateMessage(&msg);
DispatchMessageW(&msg);
Also there is a program which loads the DLL and calls the function.
Despite the Unicode window creation method, the wParam in the WM_CHAR message always contains ASCII characters, even if I type some non-ASCII symbols or use Alt+(code). Instead of UTF-16, the wParam contains some ASCII character between ‘A’ and ‘z’.
The WndProc is a static function inside the DLL.
The problem doesn’t occur when all the window-related code is inside one program.
Is there a way to always have Unicode WM_CHAR messages inside the DLL’s window?
the problem was in the message retrieval process. I used
GetMessage()with the handle of my window instead of just 0,GetMessageW(&msg, wnd_handle, 0, 0)instead ofGetMessageW(&msg, 0, 0, 0).In this way, the
WM_INPUTLANGCHANGEREQUESTmessages were swallowed and the locale remained English.