掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Delphi2010でフリガナを取得する方法 (ID:38141)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
function GetFurigana(Control: TwinControl): String; var IMC: HIMC; Len: Longint; Str: String; //String型はデフォルトでUnicode begin Imc := ImmGetContext(Control.Handle); Len := ImmGetCompositionString(Imc, GCS_RESULTREADSTR, nil, 0); //返値(Len)がバイト単位らしいので、Unicode文字列の長さは 2で割る。(ImmGetCompositionStringWでも返値はバイト単位らしい) Len := Len div 2; SetLength(Str, Len+1); ImmGetCompositionString(IMC,GCS_RESULTREADSTR, PChar(Str), Len+1); SetLength(Str, Len); Result := Str; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.