Re[2]: IMEの位置について困ってます


[コメントツリー表示を見る] [発言時刻順表示を見る]

Posted by Uz on 2000/08/31 00:43:29

In Reply to: Re: IMEの位置について困ってます Posted by Uz on 2000/08/31 00:24:39


    サンプル作ってみました。
    参考になれば幸いです。

    #適切なコントロールを置いてね!

    ' 標準モジュール
    Option Explicit

    Public Type POINTAPI
    x As Long
    y As Long
    End Type

    Public Declare Function ImmGetContext Lib "imm32.dll" ( _
    ByVal hwnd As Long _
    ) As Long

    Public Declare Function ImmSetStatusWindowPos Lib "imm32.dll" ( _
    ByVal hImc As Long, _
    lpPoint As POINTAPI _
    ) As Long

    ' フォーム
    Option Explicit

    Private Sub cmdRun_Click()
    Dim hImc As Long
    Dim pt As POINTAPI
    Dim nSt As Long

    nSt = Text1.IMEMode
    Text1.IMEMode = 0

    Call Text1.SetFocus
    hImc = ImmGetContext(Text1.hwnd)

    pt.x = 0
    pt.y = 0

    Call ImmSetStatusWindowPos(hImc, pt)
    Text1.IMEMode = nSt

    Call Text1.SetFocus
    End Sub


記事スレッド一覧