Function KeyBoardProc(ByVal nCode As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer If nCode < 0 Or nCode = 3 Then Return CallNextHookEx(m_hHook, nCode, wParam, lParam) End If Dim ret As Integer Dim iMsg As Integer If wParam = CInt(Keys.A) Then If lParam And &H80000000 Then iMsg = WM_KEYUP Else iMsg = WM_KEYDOWN End If wParam = Keys.E PostMessage(TextBox1.Handle.ToInt32, iMsg, wParam, lParam) CallNextHookEx(m_hHook, nCode, wParam, lParam) Return 1 End If End Function TextBox1のIMEモードはひらがなにしてあります。