本文整理汇总了C++中ITfInputProcessorProfiles类的典型用法代码示例。如果您正苦于以下问题:C++ ITfInputProcessorProfiles类的具体用法?C++ ITfInputProcessorProfiles怎么用?C++ ITfInputProcessorProfiles使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ITfInputProcessorProfiles类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: unregisterServer
HRESULT ImeModule::unregisterServer(const GUID& profileGuid) {
// unregister the language profile
ITfInputProcessorProfiles *inputProcessProfiles = NULL;
if(CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, (void**)&inputProcessProfiles) == S_OK) {
inputProcessProfiles->Unregister(textServiceClsid_);
inputProcessProfiles->Release();
}
// unregister categories
ITfCategoryMgr *categoryMgr = NULL;
if(CoCreateInstance(CLSID_TF_CategoryMgr, NULL, CLSCTX_INPROC_SERVER, IID_ITfCategoryMgr, (void**)&categoryMgr) == S_OK) {
categoryMgr->UnregisterCategory(textServiceClsid_, GUID_TFCAT_TIP_KEYBOARD, textServiceClsid_);
categoryMgr->UnregisterCategory(textServiceClsid_, GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, textServiceClsid_);
// UI less mode
categoryMgr->UnregisterCategory(textServiceClsid_, GUID_TFCAT_TIPCAP_INPUTMODECOMPARTMENT, textServiceClsid_);
if(isWindows8Above()) {
// Windows 8 support
categoryMgr->UnregisterCategory(textServiceClsid_, GUID_TFCAT_TIPCAP_IMMERSIVESUPPORT, textServiceClsid_);
categoryMgr->RegisterCategory(textServiceClsid_, GUID_TFCAT_TIPCAP_SYSTRAYSUPPORT, textServiceClsid_);
}
categoryMgr->Release();
}
// delete the registry key
wstring regPath = L"CLSID\\";
LPOLESTR clsidStr = NULL;
if(StringFromCLSID(textServiceClsid_, &clsidStr) == ERROR_SUCCESS) {
regPath += clsidStr;
CoTaskMemFree(clsidStr);
::SHDeleteKey(HKEY_CLASSES_ROOT, regPath.c_str());
}
return S_OK;
}
示例3: UnregisterProfiles
void UnregisterProfiles()
{
ITfInputProcessorProfiles *pInputProcessProfiles;
HRESULT hr;
hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER,
IID_ITfInputProcessorProfiles, (void **) &pInputProcessProfiles);
if (FAILED(hr))
return;
pInputProcessProfiles->Unregister(c_clsidTextService);
pInputProcessProfiles->Release();
}
示例4: 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);
}
示例5: m_hWndSource
wxZRColaFrame::wxZRColaFrame() :
m_hWndSource(NULL),
m_chrSelect(NULL),
m_settings(NULL),
m_chrReq(NULL),
wxZRColaFrameBase(NULL)
{
{
// wxFrameBuilder 3.5 does not support wxAUI_TB_HORIZONTAL flag. Add it manually.
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
paneInfo.LeftDockable(false);
paneInfo.RightDockable(false);
m_toolbarCompose->SetWindowStyleFlag(m_toolbarCompose->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Load main window icons.
#ifdef __WINDOWS__
wxIcon icon_small(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
wxIconBundle icons;
icons.AddIcon(icon_small);
icons.AddIcon(wxIcon(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
SetIcons(icons);
#else
wxIcon icon_small(wxICON(00_zrcola.ico));
SetIcon(icon_small);
#endif
m_taskBarIcon = new wxTaskBarIcon();
if (m_taskBarIcon->IsOk()) {
m_taskBarIcon->SetIcon(icon_small, _("ZRCola"));
m_taskBarIcon->Connect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
} else {
// Taskbar icon creation failed. Not the end of the world. No taskbar icon then.
delete m_taskBarIcon;
}
m_settings = new wxZRColaSettings(this);
wxPersistentRegisterAndRestore<wxZRColaSettings>(m_settings);
m_chrSelect = new wxZRColaCharSelect(this);
wxPersistentRegisterAndRestore<wxZRColaCharSelect>(m_chrSelect);
m_chrReq = new wxZRColaCharRequest(this);
wxPersistentRegisterAndRestore<wxZRColaCharRequest>(m_chrReq);
// Set focus.
m_panel->m_decomposed->SetFocus();
#if defined(__WXMSW__)
// Register notification sink for language detection.
m_ulRefCount = 1;
m_tfSource = NULL;
ITfInputProcessorProfiles *pProfiles;
HRESULT hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, (LPVOID*)&pProfiles);
if(SUCCEEDED(hr)) {
hr = pProfiles->QueryInterface(IID_ITfSource, (LPVOID*)&m_tfSource);
if(SUCCEEDED(hr)) {
hr = m_tfSource->AdviseSink(IID_ITfLanguageProfileNotifySink, (ITfLanguageProfileNotifySink*)this, &m_dwCookie);
if (FAILED(hr) || m_dwCookie == -1) {
m_tfSource->Release();
m_tfSource = NULL;
}
}
pProfiles->Release();
}
#endif
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_F4, wxID_FOCUS_CHARACTER_CATALOG);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
}