typedef LONG (WINAPI * ImmGetCompositionString_Proc)
(IN HIMC context, IN DWORD index, OUT LPVOID buffer, IN DWORD bufLen);
typedef HIMC (WINAPI * ImmGetContext_Proc) (IN HWND window);
+typedef HWND (WINAPI * ImmReleaseContext_Proc) (IN HWND wnd, IN HIMC context);
+typedef HWND (WINAPI * ImmSetCompositionWindow_Proc) (IN HIMC context,
+ IN COMPOSITIONFORM *form);
typedef HMONITOR (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags);
typedef BOOL (WINAPI * GetMonitorInfo_Proc)
(IN HMONITOR monitor, OUT struct MONITOR_INFO* info);
ClipboardSequence_Proc clipboard_sequence_fn = NULL;
ImmGetCompositionString_Proc get_composition_string_fn = NULL;
ImmGetContext_Proc get_ime_context_fn = NULL;
+ImmReleaseContext_Proc release_ime_context_fn = NULL;
+ImmSetCompositionWindow_Proc set_ime_composition_window_fn = NULL;
MonitorFromPoint_Proc monitor_from_point_fn = NULL;
GetMonitorInfo_Proc get_monitor_info_fn = NULL;
buffer = alloca(size);
size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size);
+ release_ime_context_fn (hwnd, context);
+
signal_user_input ();
for (i = 0; i < size / sizeof (wchar_t); i++)
{
break;
+ case WM_IME_STARTCOMPOSITION:
+ if (!set_ime_composition_window_fn)
+ goto dflt;
+ else
+ {
+ COMPOSITIONFORM form;
+ HIMC context;
+ struct window *w;
+
+ if (!context)
+ break;
+
+ f = x_window_to_frame (dpyinfo, hwnd);
+ w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+
+ form.dwStyle = CFS_RECT;
+ form.ptCurrentPos.x = w32_system_caret_x;
+ form.ptCurrentPos.y = w32_system_caret_y;
+
+ form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0);
+ form.rcArea.top = (WINDOW_TOP_EDGE_Y (w)
+ + WINDOW_HEADER_LINE_HEIGHT (w));
+ form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w)
+ - WINDOW_RIGHT_MARGIN_WIDTH (w)
+ - WINDOW_RIGHT_FRINGE_WIDTH (w));
+ form.rcArea.bottom = (WINDOW_BOTTOM_EDGE_Y (w)
+ - WINDOW_MODE_LINE_HEIGHT (w));
+
+ context = get_ime_context_fn (hwnd);
+ set_ime_composition_window_fn (context, &form);
+ release_ime_context_fn (hwnd, context);
+ }
+ break;
+
case WM_IME_ENDCOMPOSITION:
ignore_ime_char = 0;
goto dflt;
GetProcAddress (imm32_lib, "ImmGetCompositionStringW");
get_ime_context_fn = (ImmGetContext_Proc)
GetProcAddress (imm32_lib, "ImmGetContext");
+ release_ime_context_fn = (ImmReleaseContext_Proc)
+ GetProcAddress (imm32_lib, "ImmReleaseContext");
+ set_ime_composition_window_fn = (ImmSetCompositionWindow_Proc)
+ GetProcAddress (imm32_lib, "ImmSetCompositionWindow");
}
DEFVAR_INT ("w32-ansi-code-page",
&w32_ansi_code_page,