看板 EzHotKey 關於我們 聯絡資訊
SendMessage 改成 PostMessage 也可以用。 出處: http://homepage3.nifty.com/songs/tcode/autohotkey/kanji_input_test.ahk.txt /* 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 -- http://ioannblog.blogspot.com/         ▏▎▍▌▋▊ IOann's Notes ───────────────────────────────────── 本著作依據 Creative Commons 姓名標示-非商業性-相同方式分享 授權條款為授權 http://creativecommons.org/licenses/by-nc-sa/2.0/tw/   -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.223.174
royhsia:看不懂 03/26 00:56
※ 編輯: IOann 來自: 211.21.127.209 (07/30 20:23)