IMEのステータスウィンドウの位置設定


必要になる場面が思いつきませんが・・・。

' 標準モジュール
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