Commit f6cf1d44 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Rewrite ImmInternalSendIMEMessage helper as imc_send_message.

parent 12b5da66
...@@ -744,14 +744,11 @@ static void ImmInternalPostIMEMessage( struct imc *data, UINT msg, WPARAM wParam ...@@ -744,14 +744,11 @@ static void ImmInternalPostIMEMessage( struct imc *data, UINT msg, WPARAM wParam
PostMessageW(target, msg, wParam, lParam); PostMessageW(target, msg, wParam, lParam);
} }
/* for sending messages as the IME */ static void imc_send_message( struct imc *imc, TRANSMSG *message )
static void ImmInternalSendIMEMessage( struct imc *data, UINT msg, WPARAM wParam, LPARAM lParam )
{ {
HWND target = GetFocus(); HWND target;
if (!target) if (!(target = GetFocus()) && !(target = imc->IMC.hWnd)) return;
SendMessageW(data->IMC.hWnd,msg,wParam,lParam); SendMessageW( target, message->message, message->wParam, message->lParam );
else
SendMessageW(target, msg, wParam, lParam);
} }
static LRESULT ImmInternalSendIMENotify( struct imc *data, WPARAM notify, LPARAM lParam ) static LRESULT ImmInternalSendIMENotify( struct imc *data, WPARAM notify, LPARAM lParam )
...@@ -3014,9 +3011,7 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) ...@@ -3014,9 +3011,7 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
data->IMC.dwNumMsgBuf = 0; data->IMC.dwNumMsgBuf = 0;
lpTransMsg = ImmLockIMCC(hMsgBuf); lpTransMsg = ImmLockIMCC(hMsgBuf);
for (i = 0; i < dwNumMsgBuf; i++) for (i = 0; i < dwNumMsgBuf; i++) imc_send_message( data, lpTransMsg + i );
ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam);
ImmUnlockIMCC(hMsgBuf); ImmUnlockIMCC(hMsgBuf);
ImmDestroyIMCC(hMsgBuf); ImmDestroyIMCC(hMsgBuf);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment