本文整理汇总了C++中ITfInputProcessorProfiles::AddLanguageProfile方法的典型用法代码示例。如果您正苦于以下问题:C++ ITfInputProcessorProfiles::AddLanguageProfile方法的具体用法?C++ ITfInputProcessorProfiles::AddLanguageProfile怎么用?C++ ITfInputProcessorProfiles::AddLanguageProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITfInputProcessorProfiles
的用法示例。
在下文中一共展示了ITfInputProcessorProfiles::AddLanguageProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterProfiles
BOOL RegisterProfiles()
{
ITfInputProcessorProfiles *pInputProcessProfiles;
WCHAR achIconFile[MAX_PATH];
int cchIconFile;
HRESULT hr;
hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER,
IID_ITfInputProcessorProfiles, (void**)&pInputProcessProfiles);
if (hr != S_OK)
return E_FAIL;
hr = pInputProcessProfiles->Register(c_clsidPropertyMonitorTextService);
if (hr != S_OK)
goto Exit;
cchIconFile = GetModuleFileName(g_hInst, achIconFile, ARRAYSIZE(achIconFile));
hr = pInputProcessProfiles->AddLanguageProfile(c_clsidPropertyMonitorTextService,
TEXTSERVICE_LANGID,
c_guidProfile,
TEXTSERVICE_DESC,
lstrlen(TEXTSERVICE_DESC),
achIconFile,
cchIconFile,
TEXTSERVICE_ICON_INDEX);
Exit:
pInputProcessProfiles->Release();
return (hr == S_OK);
}
示例2: RegisterProfiles
BOOL RegisterProfiles()
{
ITfInputProcessorProfiles *pInputProcessProfiles;
WCHAR achIconFile[MAX_PATH];
char achFileNameA[MAX_PATH];
DWORD cchA;
int cchIconFile;
HRESULT hr;
hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER,
IID_ITfInputProcessorProfiles, (void**)&pInputProcessProfiles);
if (hr != S_OK)
return E_FAIL;
hr = pInputProcessProfiles->Register(c_clsidTextService);
if (hr != S_OK)
goto Exit;
cchA = GetModuleFileNameA(g_hInst, achFileNameA, ARRAYSIZE(achFileNameA));
cchIconFile = MultiByteToWideChar(CP_ACP, 0, achFileNameA, cchA, achIconFile, ARRAYSIZE(achIconFile)-1);
achIconFile[cchIconFile] = '\0';
hr = pInputProcessProfiles->AddLanguageProfile(c_clsidTextService,
TEXTSERVICE_LANGID,
c_guidProfile,
TEXTSERVICE_DESC,
(ULONG)wcslen(TEXTSERVICE_DESC),
achIconFile,
cchIconFile,
TEXTSERVICE_ICON_INDEX);
Exit:
pInputProcessProfiles->Release();
return (hr == S_OK);
}