Not able to get IME Input Context through C++ (ImmGetContext)
Hi I am trying to disable the IME on notepad using the following psuedo code:
MakeNotepadActiveWindow();//Notepad is already open and set to Japanese IME
HWND hwnd = GetTheHWNDForNotepad();
HIMC context = ImmGetContext(hwnd);
if(context == NULL)
printf("context is null %d ",GetLastError());
and the above code is always giving me the null context. GetLastError() gives 0;
Could someb开发者_开发百科ody tell me how to get the InputContext
Just in case somebody else runs into similar problem
- You can't get the input context for a window unless you own it.
- So you need to call ImmGetInputContext(hwnd) by executing the code in that window's process.
精彩评论