<br>procedure SendKeys(H: THandle; sSend: string);<br>var<br> i: integer;<br> ch: byte;<br>begin<br> SetFocus(H);<br> if H = 0 then Exit;<br> i := 1;<br> while i <= Length(sSend) do begin<br> ch := byte(sSend[i]); //send string<br> if Windows.IsDBCSLeadByte(ch) then begin<br> Inc(i);<br> SendMessage(H, WM_IME_CHAR, MakeWord(byte(sSend[i]), ch), 0);<br> end<br> else<br> SendMessage(H, WM_IME_CHAR, word(ch), 0);<br> Inc(i);<br> end;<br>end;<br>