MFC アプリケーションでは、タミル語を編集するためのダイアログで編集 ctrl が必要です。しかし、タミル語には Windows のコード ページがなく (はい、タミル語のシステム ロケールはありません)、Unicode オプションは私の状況にはありません。
SetParentを使用してHWNDを外部プロセスに埋め込むというアイデアを見た
UNICODE オプションで構築された別のアプリケーションを作成し、そのウィンドウをダイアログに埋め込みたいのですが、失敗しました。MSDN を確認してください。SetParent には、1 つのアプリケーションで親ウィンドウと子ウィンドウが必要です。
では、どうすれば実装できますか?
@MSalters
仮想 BOOL CWinThread::PumpMessage() をオーバーライドして解決し、メッセージ ループに W バージョン API を強制的に使用させました。
BOOL CtamildlgApp::PumpMessage()
{
_AFX_THREAD_STATE *pState = AfxGetThreadState();
if ( !::GetMessageW( &( pState->m_msgCur ), NULL, NULL, NULL ) )
{
// Note: prevents calling message loop things in 'ExitInstance'
// will never be decremented
return FALSE;
}
// process this message
if ( pState->m_msgCur.message != WM_KICKIDLE )
{
::TranslateMessage( &( pState->m_msgCur ) );
::DispatchMessageW( &( pState->m_msgCur ) );
}
return TRUE;
}
次に CreateWindowExW(... MSFTEDIT_CLASS ...)