https://bugs.winehq.org/show_bug.cgi?id=31157
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |imm32 Summary|Filemaker Pro 12 Trial |Filemaker Pro 12 Trial |crashes when opening a |crashes when opening a |sample solution |sample solution | |('ImmAssociateContext' | |should only generate | |'WM_IME_SETCONTEXT' if | |window has focus)
--- Comment #7 from Anastasius Focht focht@gmx.net --- Hello folks,
it seems the app's message handler doesn't like/expect 'WM_IME_SETCONTEXT' message during 'ImmAssociateContext' hence crash in some nested app code.
MSDN: http://msdn.microsoft.com/en-us/library/cc194857.aspx
--- quote --- To create an input context, call ImmCreateContext. To associate this context with a window, call ImmAssociateContext. After you have associated an input context with a window, the system will automatically provide the input context whenever the window gets the focus. The system generates a WM_IME_SETCONTEXT message; the input context is contained in the lParam. If you make changes to the input context, you should call ImmNotifyIME so that the IME can remain synchronized. To destroy the custom input context before you terminate your application, you must call ImmDestroyContext. --- quote ---
The key here is: who has the focus. The window doesn't have the focus at the point of associating the context hence it doesn't seem correct to unconditionally send 'WM_IME_SETCONTEXT' message.
Source: http://source.winehq.org/git/wine.git/blob/f0de67de0cab3e67364d699850d86325d...
--- snip --- 475 HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) 476 { ... 519 if (!hIMC) 520 return old; 521 522 if (IsWindow(data->IMC.hWnd)) 523 { 524 /* 525 * Post a message that your context is switching 526 */ 527 SendMessageW(data->IMC.hWnd, WM_IME_SETCONTEXT, FALSE, ISC_SHOWUIALL); 528 } 529 530 data->IMC.hWnd = hWnd; 531 532 if (IsWindow(data->IMC.hWnd)) 533 { 534 /* 535 * Post a message that your context is switching 536 */ 537 SendMessageW(data->IMC.hWnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL); 538 } 539 540 return old; 541 } --- snip ---
I modified the code to only send 'WM_IME_SETCONTEXT' if focused window == hWnd and it helped. The app doesn't crash and all templates/examples are loaded successfully.
Regards