6 IMEListIterator IMEList::begin()
\r
10 return list.begin();
\r
13 IMEListIterator IMEList::end()
\r
18 void IMEList::GetIMEList()
\r
24 void IMEList::GetIMM()
\r
26 const int n = GetKeyboardLayoutList(0, NULL);
\r
29 std::vector<HKL> hkls(n);
\r
30 GetKeyboardLayoutList(n, &hkls[0]);
\r
31 for (std::vector<HKL>::const_iterator p = hkls.begin(); p != hkls.end(); ++p) {
\r
33 if (ImmGetDescription(*p, info.szDescription, WINDOW_TEXT_LENGTH) &&
\r
34 ImmGetIMEFileName(*p, info.szFileName, MAX_PATH))
\r
35 list.push_back(info);
\r
39 void IMEList::GetTSF()
\r
43 ITfInputProcessorProfiles *pProfiles;
\r
44 hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, reinterpret_cast<LPVOID*>(&pProfiles));
\r
49 const LANGID langid = GetUserDefaultLangID();
\r
50 IEnumTfLanguageProfiles *pEnum;
\r
51 hr = pProfiles->EnumLanguageProfiles(langid, &pEnum);
\r
54 TF_LANGUAGEPROFILE prof;
\r
56 while (pEnum->Next(1, &prof, &fetch) == S_OK) {
\r
58 hr = pProfiles->GetLanguageProfileDescription(prof.clsid, langid, prof.guidProfile, &bstr);
\r
63 WideCharToMultiByte(CP_ACP, 0, bstr, -1, info.szDescription, MAX_PATH, NULL, NULL);
\r
65 wcscpy_s(info.szDescription, WINDOW_TEXT_LENGTH, bstr);
\r
68 for (IMEListIterator p = list.begin(); p != list.end(); ++p)
\r
69 if (!_tcscmp(info.szDescription, p->szDescription)) { // already get via IMM
\r
74 _tcscpy_s(info.szFileName, _T("IME"));
\r
75 list.push_back(info);
\r
81 pProfiles->Release();
\r