Skip to content

Commit

Permalink
Merge pull request #460 from beru/ImmSetCompositionWindow
Browse files Browse the repository at this point in the history
IME編集エリアの位置変更を行う ImmSetCompositionWindow の呼び出しは IMEが開いている時だけに限定
  • Loading branch information
beru authored Sep 19, 2018
2 parents f411bb3 + e954b54 commit 9206b29
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sakura_core/view/CEditView_Ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ void CEditView::SetIMECompFormPos( void )
// composition window position.
//
//
COMPOSITIONFORM CompForm;
HIMC hIMC = ::ImmGetContext( GetHwnd() );
POINT point;

::GetCaretPos( &point );
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = (long) point.x;
CompForm.ptCurrentPos.y = (long) point.y + GetCaret().GetCaretSize().cy - GetTextMetrics().GetHankakuHeight();

HIMC hIMC = ::ImmGetContext( GetHwnd() );
if ( hIMC ){
::ImmSetCompositionWindow( hIMC, &CompForm );
if ( ::ImmGetOpenStatus( hIMC ) ){
POINT point;
::GetCaretPos( &point );
COMPOSITIONFORM CompForm;
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = (long) point.x;
CompForm.ptCurrentPos.y = (long) point.y + GetCaret().GetCaretSize().cy - GetTextMetrics().GetHankakuHeight();
::ImmSetCompositionWindow( hIMC, &CompForm );
}
::ImmReleaseContext( GetHwnd() , hIMC );
}
::ImmReleaseContext( GetHwnd() , hIMC );
}


Expand Down

0 comments on commit 9206b29

Please sign in to comment.