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.description, WINDOW_TEXT_LENGTH) &&
\r
34 ImmGetIMEFileName(*p, info.filename, MAX_PATH))
\r
35 list.push_back(info);
\r
39 void IMEList::GetTSF()
\r
42 ITfInputProcessorProfiles *ipp;
\r
43 if (FAILED(CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ipp)))) {
\r
47 ITfInputProcessorProfileMgr *mgr;
\r
48 if (FAILED(ipp->QueryInterface(&mgr)))
\r
50 TF_INPUTPROCESSORPROFILE prof;
\r
51 if (FAILED(mgr->GetActiveProfile(GUID_TFCAT_TIP_KEYBOARD, &prof))) {
\r
56 if (prof.dwProfileType != TF_PROFILETYPE_INPUTPROCESSOR) // current IME is not TIP
\r
59 if (FAILED(ipp->GetLanguageProfileDescription(prof.clsid, prof.langid, prof.guidProfile, &bstr)))
\r
63 WideCharToMultiByte(CP_ACP, 0, bstr, -1, info.description, WINDOW_TEXT_LENGTH, NULL, NULL);
\r
65 wcscpy_s(info.description, WINDOW_TEXT_LENGTH, bstr);
\r
67 _tcscpy_s(info.filename, _T("IME"));
\r
68 list.push_back(info);
\r