{"id":20061742,"url":"https://github.com/katahiromz/imestudy","last_synced_at":"2025-05-05T16:30:58.187Z","repository":{"id":74404453,"uuid":"546967901","full_name":"katahiromz/ImeStudy","owner":"katahiromz","description":"Windows IME/IMM Study by katahiromz","archived":false,"fork":false,"pushed_at":"2024-08-15T05:40:57.000Z","size":5899,"stargazers_count":24,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-15T06:41:37.631Z","etag":null,"topics":["articles","asian","chinese-language","ime","imm32","input-method","japanese-language","korean-language","study","win32","win32api","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/katahiromz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-07T00:02:20.000Z","updated_at":"2024-08-15T05:41:01.000Z","dependencies_parsed_at":"2024-08-15T13:45:30.152Z","dependency_job_id":null,"html_url":"https://github.com/katahiromz/ImeStudy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katahiromz%2FImeStudy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katahiromz%2FImeStudy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katahiromz%2FImeStudy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katahiromz%2FImeStudy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katahiromz","download_url":"https://codeload.github.com/katahiromz/ImeStudy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224454586,"owners_count":17313981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["articles","asian","chinese-language","ime","imm32","input-method","japanese-language","korean-language","study","win32","win32api","windows"],"created_at":"2024-11-13T13:23:03.866Z","updated_at":"2024-11-13T13:23:04.600Z","avatar_url":"https://github.com/katahiromz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Windows IME/IMM Study by katahiromz\n\nこのレポジトリは、WindowsのIME/IMMに関する研究をまとめたものです。\n\n- [ARTICLES](ARTICLES/README.md) - 日本語の記事です。\n- [STUDY](STUDY/README.md) - 研究らしきものです。\n\n## What is IME?\n\nIME is Input Method Editor, that is text conversion software for Far East Asian Windows users.\nIME allows the Far East Asian users to input Far East Asian text.\n\nThe body of an IME is a DLL file that is registered as an IME in the operating system.\nAn IME can provide the functions whose names begin with `\"Ime\"`, and `NotifyIME` function.\n\nUsually, the IME software has to provide its IME installer to register itself into the system.\n\nFor more details, see IME Hackerz (`REF011` and `REF012`).\n\n## What is IMM?\n\nIMM is Input Method Manager for Windows, that provides the interface between the user and an IME software.\n\n## What is IMM32?\n\nIMM32 is 32-bit IMM for Windows. That is a DLL file that is located in `C:\\Windows\\system32` as the name of \"imm32.dll\".\n\nIMM32 provides API functions whose names begin with `\"Imm\"`. For more details, see IME Hackerz.\n\n## How to use IMM32 in my program?\n\nFirst, please include `\u003cimm.h\u003e` and link to `imm32.dll` as follows:\n\n```c\n#include \u003cwindows.h\u003e\n#include \u003cimm.h\u003e\n#pragma comment(lib, \"imm32.lib\")\n```\n\nAnd then use the following basic form:\n\n```c\nHIMC hImc = ImmGetContext(hWnd);\n...(Use IMM functions against hImc)...\nImmReleaseContext(hWnd, hImc);\n```\n\nThe IMM function has a name that begins with `Imm`, those are listed at https://katahiromz.web.fc2.com/colony3rd/imehackerz/en/functions.html .\n\n## What is \"keyboard layout\"?\n\nThe key code system differs depending on the keyboard or the keyboard language.\nThe position of the physical key may change.\nAlso, the key code mapping may change.\n\nUsually, Japanese people uses Japanese keyboards.\nChinese people uses Chinese or English keyboards.\nKorean people uses Korean keyboards.\nJapanese user doesn't want to use English keyboard to input Japanese text.\n\n## What is Chinese?\n\nThat is Asian people and/or languages, that is mainly living in the continent of Far East.\nThey use Chinese characters.\nMany Chinese are not Japanese nor Korean.\n\nSee also `REF020`.\n\n## What is Japanese?\n\nThat is Asian people and/or languages, that is mainly living in the islands of Far East.\nThey use Hiragana, Katakana, Kanji and English characters.\nMany Japanese are not Chinese nor Korean.\n\nSee also `REF021`.\n\n## What is Korean?\n\nThat is Asian people and/or language, that is mainly living in the peninsula of Far East.\nThey use Hangul characters (like 김정은) and English characters.\nMany Korean are not Chinese nor Japanese.\n\nSee also `REF022`.\n\n## What is Zenkaku or Hankaku?\n\nA Hankaku (半角) character is a single-byte character in Shift_JIS (except UTF-8).\nA non-Hankaku character is a Zenkaku (全角) character (in Traditional Japanese).\nTraditionally, a non-single-byte character (in Shift_JIS encoding) has double width of a Hankaku character.\nA Japanese fixed-width font should follow this traditional rule.\n\n## What is Hiragana and Katakana?\n\n- Hiragana (ひらがな) is a Japanese phonetic character collection (like あいうえお etc.).\n- Katakana (カタカナ) is a Japanese phonetic character collection (like アイウエオ etc.).\n\n## Why so many characters in Japanese?\n\nJapanese text was born as a domestic international language through exchanges with China and neighboring countries.\n\n1. Japanese didn't have any characters in the initial time. Japanese was sounds only.\n2. The character of Katakana is derived from part(s) of Chinese Kanji, to write pronunciation of foreign word.\n3. The character of Hiragana is derived from a deformation of Chinese Kanji, to write Japanese word.\n4. Many Kanji characters also continued to be used frequently.\n\n## What is Kana?\n\nKana (かな/カナ) is Hiragana and/or Katakana.\n\n## What is Kanji?\n\nThe Kanji (漢字) characters in Japanese originate on the Chinese characters (like 亜阿唖).\n\n## What is Kanji radical?\n\nThe Kanji radical (部首) is a systematic component of the Chinese character (or a Kanji character).\n\n## What is Romaji conversion?\n\nRomaji conversion (ローマ字変換) is a translation from English alphabet text into Kana character text.\n\n## What is Kana-Kanji conversion?\n\nKana-Kanji conversion (かな漢字変換) is a conversion from Kana text into Kanji or something text.\nA normal Japanese keyboard cannot type the Kanji characters directly.\n\n## How is the Japanese keyboard?\n\nThe current Japanese keyboard standard is 109-keyboard.\nIt can type English alphabet and Hiragana characters, and some Japanese symbols and punctuations.\nAdditionally it has the `VK_KANJI`, `VK_KANA`, `VK_CONVERT`, and `VK_NONCONVERT` virtual keys.\n\n- `VK_KANJI` (半角／全角) key is Hankaku/Zenkaku key to toggle Hankaku input mode and Zenkaku input mode.\n- `VK_KANA` (かな) key is Kana key to begin the Kana (Hiragana and Katakana) input or toggle the Hiragana mode and the Katakana mode. These two modes are exclusive.\n- `VK_CONVERT` (変換) is Convert key to convert the text.\n- `VK_NONCONVERT` (無変換) is Don't-Convert key to revert conversion.\n\nSome punctuation key mapping differs from English key mapping.\n\n## How is the Chinese keyboard?\n\nIt can type English alphabet and the Chinese radical symbols.\nChinese keyboard is usually compatible to English keyboard.\nOptionally, the Chinese radical symbols are printed on key tops.\n\n## How is the Korean keyboard?\n\nIt can type English alphabet and the Hangul radical symbols.\nAdditionally, it has `VK_HANGUL`, `VK_JUNJA` and `VK_HANJA` virtual keys.\n\n- `VK_HANGUL` is the Hangul input mode key (same as `VK_KANA`).\n- `VK_JUNJA` is the Junja mode key.\n- `VK_HANJA` is the Hanja mode key.\n\n## How to input Japanese text?\n\nA normal Japanese keyboard cannot type the Kanji characters directly.\nThe Japanese user inputs the Hiragana text (or Romaji-converted text) into IME and converts into Kanji or something text by the IME.\n\nThere is Romaji input mode and Kana input mode. These modes are exclusive. You can toggle these modes by `Alt+VK_KANA` key.\nIn Romaji input mode, typing Alphabet key makes translation from English Alphabet to Kana.\nIn Kana input mode, typing actual Hiragana key makes Hiragana character input.\n\nTo begin Japanese text, press `Alt+VK_KANJI` (or simply `VK_KANJI` in new Windows).\nIt enables Zenkaku mode and \"あ\" will be displayed on Taskbar or IME bar.\nPressing `Alt+VK_KANJI` again, it disables Zenkaku mode and \"A\" will be displayed on Taskbar or IME bar (Hankaku mode).\n\nIn Zenkaku mode, the Zenkaku characters that the user typed is displayed with underlined text (indeterminated composition text).\nThen `Space` key or `VK_CONVERT` key makes Kana-Kanji conversion of that text.\nThen the conversion candidates will be displayed with highlighted text.\nPressing `Space` or `VK_CONVERT` key again makes next Kana-Kanji conversion (it might show the list of the candidates).\nPressing `Enter` key commits the conversion text and that the selected candidate text will be actually entered the text box.\n`Esc` key in Zenkaku mode makes cancellation of conversion.\n\n## How to input Chinese text?\n\nThe Chinese user enters the Kanji radicals into IME.\nThe IME in Kanji mode automatically converts them into Kanji characters.\n\n## Where is free Japanese IME?\n\nSee `REF013` (`mzimeja`).\n\n## What is `DefWindowProc`?\n\n`DefWindowProc` is the default window procedure.\nThere are two versions of it, as `DefWindowProcA` (ANSI version) and `DefWindowProcW` (Unicode version).\nIf the application window doesn't process the window message, then the window message will be processed by `DefWindowProc`.\n\n## What is `EDIT` control?\n\nThe `EDIT` control is a text box, that is a child window whose window class name is `\"Edit\"`.\n\n## What is standard IME message?\n\nThe standard IME messages are the Windows messages whose names begin with `\"WM_IME_\"`.\n\n## What is Cicero?\n\nCicero is the code name of TSF.\n\n## What is TSF?\n\nTSF stands for \"Text Services Framework\".\nTSF appears on Windows XP and later.\nIt has many other names, such as \"Text Framework\", \"Text Services\", \"Text Frame Service\" etc.\nTSF is an empowered framework over IMM32.\nTSF has COM (Component Object Model)-based design.\n\nOld IMM32-based IME runs under \"CUAS\" emulation layer of TSF.\nNew IMM32 has `ImmDisableTextFrameService` API to disable TSF in the thread. See `REF024`.\n\n## What is CUAS?\n\nCUAS (Cicero Unaware Application Support) is an emulation layer that connects between the old IMM32-based application and a TSF TIP.\n\n## What is COM (Component Object Model)?\n\nSee `REF023`.\n\n## What does an IME installer?\n\nIt copys the IME-related files into the system, writes some settings in the registry, and call the `ImmInstallIME` function.\n\n## What is registry key `\"Run\"`?\n\nRegistry key `\"Run\"` is as follows:\n\n- In cases of Windows 95/98/Me: `\"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\"`\n- In the other cases: `\"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\"`\n\nThis registry key contains the list of the registered start-up entries.\nThe key of an entry is the start-up program name. The value of an entry is a start-up command line.\n\n## What is `internat.exe`?\n\n`internat.exe` is an old program that is called \"international keyboard/language indicator applet\".\nWindows 95, Windows 98, Windows Me, and Windows 2000 had `internat.exe`.\nThis program can display and choose a keyboard / IME from notification area of task bar.\nIt creates an invisible window `\"Indicator\"`.\nIt is a start-up program.\nSome keyboard/IME settings can register `internat.exe` to registry key `\"Run\"`.\nIt manages keyboard layout list.\n\n## What is `ctfmon.exe`?\n\n`ctfmon.exe` is Language Bar front-end and a replacement of `internat.exe`.\nThis program can also display and choose a keyboard / IME from Language Bar.\n`ctfmon.exe` hates `internat.exe`.\n`ctfmon.exe` kills `internat.exe` process, `\"Indicator\"` window, and registry key `\"Run\"` entry of `internat.exe`.\n`ctfmon.exe` is a start-up program.\n`ctfmon.exe` registers itself as a start-up program to registry key `\"Run\"`.\n\nSee `$(REACTOS)/base/applications/ctfmon` .\n\n## What is `HKL`?\n\nA handle of keyboard layout.\n\nThe LOWORD of an HKL is a language ID.\n\n```txt\n#define IS_IME_HKL(hKL)     ((((ULONG_PTR)(hKL)) \u0026 0xF0000000) == 0xE0000000)\n#define IS_SPECIAL_HKL(hKL) ((((ULONG_PTR)(hKL)) \u0026 0xF0000000) == 0xF0000000)\n```\n\nIf `IS_IME_HKL(hKL)` is `TRUE`, then `hKL` is a handle for an IME keyboard layout.\nIf `IS_SPECIAL_HKL(hKL)` is `TRUE`, then `hKL` is a handle for a special keyboard layout.\n\nSee `$(REACTOS)/dll/cpl/input/layout_list.c` and registry key `\"Keyboard Layouts\"` for details.\n\n## What is registry key `\"Keyboard Layouts\"`?\n\nThe registry key `\"Keyboard Layouts\"` is located at:\n\n- `HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts` .\n\nSee `$(REACTOS)/dll/cpl/input/layout_list.c`.\n\n## What is a keyboard layout list?\n\nA \"keyboard layout list\" is the list of HKLs that can obtain from `USER32!GetKeyboardLayoutList` function.\n`internat.exe` manages the keyboard layout list.\n\n## What is CTF?\n\nCTF stands for \"Collaborative Translation Framework\".\n\nCTF provides `msctf.dll`, `msctfime.ime`, CTF IMEs etc.\n\n## What is IMM IME?\n\nIt is a DLL file that contains the following exported functions:\n\n- `ImeInquire`\n- `ImeConversionList`\n- `ImeRegisterWord`\n- `ImeUnregisterWord`\n- `ImeGetRegisterWordStyle`\n- `ImeEnumRegisterWord`\n- `ImeConfigure`\n- `ImeDestroy`\n- `ImeEscape`\n- `ImeProcessKey`\n- `ImeSelect`\n- `ImeSetActiveContext`\n- `ImeToAsciiEx`\n- `NotifyIME`\n- `ImeSetCompositionString`\n- `ImeGetImeMenuItems`\n\nAnd it must have a version info in the following conditions (See `IMM32!ImmLoadLayout`):\n\n- The `FILETYPE` value must be `VFT_DRV` (`0x3`).\n- The `FILESUBTYPE` value must be `VFT2_DRV_INPUTMETHOD` (`0xB`).\n- The `StringFileInfo` block must contain correct codepage, language, and `FileDescription` values.\n\nUsually an installed IME file is in `%WINDIR%\\system32`.\nThe filename extension is `\".ime\"`.\n\nSee `$(REACTOS)/sdk/include/reactos/imetable.h` and `$(REACTOS)/dll/win32/imm32/utils.c` .\n\n## What is CTF IME?\n\nIt is an extension of \"IMM IME\". It contains the IMM IME functions and the following exported functions:\n\n- `CtfImeInquireExW`\n- `CtfImeSelectEx`\n- `CtfImeEscapeEx`\n- `CtfImeGetGuidAtom`\n- `CtfImeIsGuidMapEnable`\n\nSee `$(REACTOS)/sdk/include/reactos/imetable.h` and `$(REACTOS)/dll/win32/imm32/ctf.c` .\n\n## How to export functions?\n\nJust define the functions and add a `.DEF` file to your DLL file project.\n\n## What is TIP?\n\nTIP stands for \"Text Input Processor\".\nThe new-style IME of new design is called as TIP.\nA TIP is a DLL file, that is built with many COM objects and interfaces.\nThe filename extension of a TIP is usually `.dll`.\nStrictly saying, a TIP is not an IME file (Not IMM IME nor CTF IME!).\n\n## What is `msctfime.ime`?\n\nThe system IME file `msctfime.ime` is the back-end of TIP.\n`msctfime.ime` communicates with the current TIP.\n\nYou can find the name of `msctfime.ime` in registry key:\n\n- `HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM`\n\nof Windows XP/2003.\n\nSee `$(REACTOS)/dll/ime/msctfime` .\n\n## What is `msutb.dll`?\n\n`msutb.dll` is the back-end of TIP Bar.\n\n## What is `msctf.dll`?\n\n`msctf.dll` is the back-end of Language Bar.\n\nSee `$(REACTOS)/dll/win32/msctf` .\n\n## Reference\n\n- `REF000`: The Internet Archive: WayBack Machine: https://archive.org/web\n- `REF001`: WineHQ (free Windows Emulator): https://www.winehq.org\n- `REF002`: WineHQ Repository: https://github.com/wine-mirror/wine\n- `REF003`: ReactOS (free Windows-compatible OS): https://www.reactos.org\n- `REF004`: ReactOS Repository: https://github.com/reactos/reactos\n- `REF005`: WineHQ IMM32 source: https://github.com/wine-mirror/wine/tree/master/dlls/imm32\n- `REF006`: WineHQ USER32 source: https://github.com/wine-mirror/wine/tree/master/dlls/user32\n- `REF007`: ReactOS IMM32 source: https://github.com/reactos/reactos/tree/master/dll/win32/imm32\n- `REF008`: ReactOS USER32 source: https://github.com/reactos/reactos/tree/master/win32ss/user\n- `REF009`: Win32 Multilingual IME Application Programming Interface Version 1.41 ([ime-api.pdf](ime-api.pdf))\n- `REF010`: Win32 Multilingual IME Overview for IME Development Version 1.41 ([ime-overview.pdf](ime-overview.pdf))\n- `REF011`: IME Hackerz (English): https://katahiromz.web.fc2.com/colony3rd/imehackerz/en\n- `REF012`: IME Hackerz (Japanese): https://katahiromz.web.fc2.com/colony3rd/imehackerz/ja\n- `REF013`: MZ-IME Japanese Input for Windows XP/2003 (mzimeja): https://github.com/katahiromz/mzimeja\n- `REF014`: Wikipedia: Hiragana: https://en.wikipedia.org/wiki/Hiragana\n- `REF015`: Wikipedia: Kanji: https://en.wikipedia.org/wiki/Kanji\n- `REF016`: Wikipedia: Katakana: https://en.wikipedia.org/wiki/Katakana\n- `REF017`: Wikipedia: Kanji: https://en.wikipedia.org/wiki/IME\n- `REF018`: Wikipedia: Input method: https://en.wikipedia.org/wiki/Input_method\n- `REF019`: Wikipedia: Keyboard layout: https://en.wikipedia.org/wiki/Keyboard_layout\n- `REF020`: Wikipedia: Chinese language: https://en.wikipedia.org/wiki/Chinese_language\n- `REF021`: Wikipedia: Japanese language: https://en.wikipedia.org/wiki/Japanese_language\n- `REF022`: Wikipedia: Korean language: https://en.wikipedia.org/wiki/Korean_language\n- `REF023`: Wikipedia: Component Object Model: https://en.wikipedia.org/wiki/Component_Object_Model\n- `REF024`: Text Services Framework: https://docs.microsoft.com/ja-jp/windows/desktop/TSF/text-services-framework\n- `REF025`: WinHier: Win32 spying utility: https://github.com/katahiromz/WinHier\n- `REF026`: RisohEditor: Another free Win32 resource editor: https://github.com/katahiromz/RisohEditor\n- `REF027`: MsgCrack: Code snippet for event handler: https://github.com/katahiromz/MsgCrack\n- `REF028`: vkeycheck: Virtual Key checker: https://github.com/katahiromz/vkeycheck\n- `REF029`: IME as a possible keylogger: https://www.virusbulletin.com/virusbulletin/2005/11/ime-possible-keylogger/\n- `REF030`: dwendt/UniversalInject: https://github.com/dwendt/UniversalInject\n- `REF031`: https://reactos.org/wiki/User:Alvinhochun/Localization/IME\n- `REF032`: SampleIME: https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/IME/cpp/SampleIME\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatahiromz%2Fimestudy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatahiromz%2Fimestudy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatahiromz%2Fimestudy/lists"}