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


C++ ITfKeystrokeMgr类代码示例

本文整理汇总了C++中ITfKeystrokeMgr的典型用法代码示例。如果您正苦于以下问题:C++ ITfKeystrokeMgr类的具体用法?C++ ITfKeystrokeMgr怎么用?C++ ITfKeystrokeMgr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ITfKeystrokeMgr类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _UninitPreservedKey

void CTextService::_UninitPreservedKey(int onoff)
{
	HRESULT hr;

	if(onoff != 0 && onoff != 1)
	{
		return;
	}

	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		for(int i = 0; i < MAX_PRESERVEDKEY; i++)
		{
			if(preservedkey[onoff][i].uVKey == 0 && preservedkey[onoff][i].uModifiers == 0)
			{
				break;
			}

			hr = pKeystrokeMgr->UnpreserveKey(c_guidPreservedKeyOnOff[onoff], &preservedkey[onoff][i]);
		}

		SafeRelease(&pKeystrokeMgr);
	}
}
开发者ID:kozo2,项目名称:tsf-tutcode,代码行数:25,代码来源:KeyEventSink.cpp

示例2: _InitPreservedKey

BOOL CTextService::_InitPreservedKey()
{
    ITfKeystrokeMgr *pKeystrokeMgr;
    HRESULT hr;

    if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK)
        return FALSE;

    // register Alt+~ key
    hr = pKeystrokeMgr->PreserveKey(_tfClientId, 
                                    GUID_PRESERVEDKEY_ONOFF,
                                    &c_pkeyOnOff0,
                                    c_szPKeyOnOff,
                                    lstrlen(c_szPKeyOnOff));

    // register KANJI key
    hr = pKeystrokeMgr->PreserveKey(_tfClientId, 
                                    GUID_PRESERVEDKEY_ONOFF,
                                    &c_pkeyOnOff1,
                                    c_szPKeyOnOff,
                                    lstrlen(c_szPKeyOnOff));

    // register F6 key
    hr = pKeystrokeMgr->PreserveKey(_tfClientId, 
                                    GUID_PRESERVEDKEY_F6,
                                    &c_pkeyF6,
                                    c_szPKeyF6,
                                    lstrlen(c_szPKeyF6));

    pKeystrokeMgr->Release();

    return (hr == S_OK);
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:33,代码来源:KeyEventSink.cpp

示例3: _InitPreservedKey

BOOL CTextService::_InitPreservedKey()
{
    ITfKeystrokeMgr *pKeystrokeMgr;
    HRESULT hr;

    if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK)
        return FALSE;

    // register VK_F2 key
    hr = pKeystrokeMgr->PreserveKey(_tfClientId, 
                                    GUID_PRESERVEDKEY_BURGLISH,
                                    &c_pkeyburglish,
                                    c_szPKeyOnOff,
                                    wcslen(c_szPKeyOnOff));

	hr = pKeystrokeMgr->PreserveKey(_tfClientId, 
                                    GUID_PRESERVEDKEY_BURMESE,
                                    &c_pkeyburmese,
                                    c_szPKeyOnOff,
                                    wcslen(c_szPKeyOnOff));

    pKeystrokeMgr->Release();

    return (hr == S_OK);
}
开发者ID:yathit,项目名称:zawgyi,代码行数:25,代码来源:KeyEventSink.cpp

示例4: _UninitKeyEventSink

void CTextService::_UninitKeyEventSink()
{
	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		pKeystrokeMgr->UnadviseKeyEventSink(_ClientId);
		SafeRelease(&pKeystrokeMgr);
	}
}
开发者ID:hkgsherlock,项目名称:canto,代码行数:9,代码来源:KeyEventSink.cpp

示例5: _UninitKeyEventSink

void WeaselTSF::_UninitKeyEventSink()
{
	ITfKeystrokeMgr *pKeystrokeMgr;
	
	if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **) &pKeystrokeMgr) != S_OK)
		return;

	pKeystrokeMgr->UnadviseKeyEventSink(_tfClientId);
	pKeystrokeMgr->Release();
}
开发者ID:wlnetman,项目名称:weasel,代码行数:10,代码来源:KeyEventSink.cpp

示例6: _UninitPreservedKey

void CTextService::_UninitPreservedKey()
{
    ITfKeystrokeMgr *pKeystrokeMgr;

    if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK)
        return;

    pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_BURGLISH, &c_pkeyburglish);
	pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_BURMESE, &c_pkeyburmese);

    pKeystrokeMgr->Release();
}
开发者ID:yathit,项目名称:zawgyi,代码行数:12,代码来源:KeyEventSink.cpp

示例7: _UninitPreservedKey

void CTextService::_UninitPreservedKey()
{
    ITfKeystrokeMgr *pKeystrokeMgr;

    if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK)
        return;

    pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_ONOFF, &c_pkeyOnOff0);
    pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_ONOFF, &c_pkeyOnOff1);
    pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_F6,    &c_pkeyF6);

    pKeystrokeMgr->Release();
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:13,代码来源:KeyEventSink.cpp

示例8: _InitKeyEventSink

BOOL CTextService::_InitKeyEventSink()
{
	HRESULT hr = E_FAIL;

	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		hr = pKeystrokeMgr->AdviseKeyEventSink(_ClientId, (ITfKeyEventSink *)this, TRUE);
		SafeRelease(&pKeystrokeMgr);
	}

	return (hr == S_OK);
}
开发者ID:hkgsherlock,项目名称:canto,代码行数:13,代码来源:KeyEventSink.cpp

示例9: _InitKeyEventSink

BOOL WeaselTSF::_InitKeyEventSink()
{
	ITfKeystrokeMgr *pKeystrokeMgr;
	HRESULT hr;

	if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **) &pKeystrokeMgr) != S_OK)
		return FALSE;

	hr = pKeystrokeMgr->AdviseKeyEventSink(_tfClientId, (ITfKeyEventSink *) this, TRUE);
	pKeystrokeMgr->Release();
	
	return (hr == S_OK);
}
开发者ID:wlnetman,项目名称:weasel,代码行数:13,代码来源:KeyEventSink.cpp

示例10: addPreservedKey

// preserved key
void TextService::addPreservedKey(UINT keyCode, UINT modifiers, const GUID& guid) {
	PreservedKey preservedKey;
	preservedKey.guid = guid;
	preservedKey.uVKey = keyCode;
	preservedKey.uModifiers = modifiers;
	preservedKeys_.push_back(preservedKey);
	if(threadMgr_) { // our text service is activated
		ITfKeystrokeMgr *keystrokeMgr;
		if (threadMgr_->QueryInterface(IID_ITfKeystrokeMgr, (void **)&keystrokeMgr) == S_OK) {
			keystrokeMgr->PreserveKey(clientId_, guid, &preservedKey, NULL, 0);
			keystrokeMgr->Release();
		}
	}
}
开发者ID:Java2ByteCode,项目名称:PIME,代码行数:15,代码来源:TextService.cpp

示例11: _UninitPreservedKey

void CTextService::_UninitPreservedKey()
{
	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		for(int i = 0; i < MAX_PRESERVEDKEY; i++)
		{
			if(preservedkey[i].uVKey == 0 && preservedkey[i].uModifiers == 0)
			{
				break;
			}
			pKeystrokeMgr->UnpreserveKey(c_guidPreservedKeyOnOff, &preservedkey[i]);
		}
		SafeRelease(&pKeystrokeMgr);
	}
}
开发者ID:hkgsherlock,项目名称:canto,代码行数:16,代码来源:KeyEventSink.cpp

示例12: removePreservedKey

void TextService::removePreservedKey(const GUID& guid) {
	vector<PreservedKey>::iterator it;
	for(it = preservedKeys_.begin(); it != preservedKeys_.end(); ++it) {
		PreservedKey& preservedKey = *it;
		if(::IsEqualIID(preservedKey.guid, guid)) {
			if(threadMgr_) { // our text service is activated
				ITfKeystrokeMgr *keystrokeMgr;
				if (threadMgr_->QueryInterface(IID_ITfKeystrokeMgr, (void **)&keystrokeMgr) == S_OK) {
					keystrokeMgr->UnpreserveKey(preservedKey.guid, &preservedKey);
					keystrokeMgr->Release();
				}
			}
			preservedKeys_.erase(it);
			break;
		}
	}
}
开发者ID:Java2ByteCode,项目名称:PIME,代码行数:17,代码来源:TextService.cpp

示例13: _InitPreservedKey

BOOL CTextService::_InitPreservedKey()
{
	HRESULT hr = E_FAIL;

	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		for(int i = 0; i < MAX_PRESERVEDKEY; i++)
		{
			if(preservedkey[i].uVKey == 0 && preservedkey[i].uModifiers == 0)
			{
				break;
			}
			hr = pKeystrokeMgr->PreserveKey(_ClientId, c_guidPreservedKeyOnOff,
				&preservedkey[i], c_PreservedKeyDesc, (ULONG)wcslen(c_PreservedKeyDesc));
		}
		SafeRelease(&pKeystrokeMgr);
	}

	return (hr == S_OK);
}
开发者ID:hkgsherlock,项目名称:canto,代码行数:21,代码来源:KeyEventSink.cpp

示例14: _InitPreservedKey

BOOL CTextService::_InitPreservedKey(int onoff)
{
	BOOL fRet = TRUE;
	HRESULT hr;

	if(onoff != 0 && onoff != 1)
	{
		return FALSE;
	}

	ITfKeystrokeMgr *pKeystrokeMgr;
	if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK)
	{
		for(int i = 0; i < MAX_PRESERVEDKEY; i++)
		{
			if(preservedkey[onoff][i].uVKey == 0 && preservedkey[onoff][i].uModifiers == 0)
			{
				break;
			}

			hr = pKeystrokeMgr->PreserveKey(_ClientId, c_guidPreservedKeyOnOff[onoff],
				&preservedkey[onoff][i], c_PreservedKeyDesc[onoff], (ULONG)wcslen(c_PreservedKeyDesc[onoff]));

			if(hr != S_OK)
			{
				fRet = FALSE;
			}
		}

		SafeRelease(&pKeystrokeMgr);
	}
	else
	{
		fRet = FALSE;
	}

	return fRet;
}
开发者ID:kozo2,项目名称:tsf-tutcode,代码行数:38,代码来源:KeyEventSink.cpp


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