/* AutoHotkey 入力テスト */ ; WM_IME_CHAR ; MS Word 他で入力可能 SendByWmImeChar(InputString) { InputStringPtr := &InputString Loop { if *InputStringPtr = 0 break if *InputStringPtr > 127 { mbc := ((*InputStringPtr << 8) | *(InputStringPtr+1)) InputStringPtr := InputStringPtr + 2 } else { mbc := *(InputStringPtr) InputStringPtr := InputStringPtr + 1 } ControlGetFocus, control, A SendMessage, 0x286, mbc, 0, %control%, A ; 0x286 WM_IME_CHAR } return } F10:: SendByWmImeChar("漢字入力テスト") return ; WM_CHAR ; Notepad では使用できるが、MS Word では入力できないみたい。 F11:: mbc := "漢" ControlGetFocus, control, A SendMessage, 0x102, *(&mbc), 0, %control%, A ; 0x102 WM_CHAR SendMessage, 0x102, *(&mbc+1), 0, %control%, A ; 0x102 WM_CHAR return ; WM_UNICHAR ; Unicode 使用。Skype などで入力できる。 F12:: ControlGetFocus, control, A SendMessage, 0x109, 0x3042, 0, %control%, A ; WM_UNICHAR 0x0109 0x3042=あ unicode return