It seems to work with ImmSetCompositionWindow
But I had to intercept messages like WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION, ... in the main message loop
and I called ImmAssociateContextEx at beginning :
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to move the IME window to specific position on the screen. And if possible, relative to the client area. How can I achieve this with Win32?
It seems to work with ImmSetCompositionWindow
But I had to intercept messages like WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION, ... in the main message loop
and I called ImmAssociateContextEx at beginning :
Hi, @thebluetropics
Using ImmSetCompositionWindow is effective.
if (uMsg == WM_IME_COMPOSITION)
{
HIMC hIMC = ImmGetContext(m_hWnd);
if (hIMC)
{
// Set composition window position near caret position
POINT point;
GetCaretPos(&point);
COMPOSITIONFORM Composition;
Composition.dwStyle = CFS_POINT;
Composition.ptCurrentPos.x = point.x;
Composition.ptCurrentPos.y = point.y;
ImmSetCompositionWindow(hIMC, &Composition);
ImmReleaseContext(m_hWnd,hIMC);
}
Thank you.