当前位置: 首页>>代码示例>>C++>>正文


C++ ITfInputProcessorProfiles::AddLanguageProfile方法代码示例

本文整理汇总了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);
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:32,代码来源:Register.cpp

示例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);
}
开发者ID:aungkozaw,项目名称:zawgyi,代码行数:38,代码来源:Register.cpp


注:本文中的ITfInputProcessorProfiles::AddLanguageProfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。