本文整理汇总了C++中ImmReleaseContext函数的典型用法代码示例。如果您正苦于以下问题:C++ ImmReleaseContext函数的具体用法?C++ ImmReleaseContext怎么用?C++ ImmReleaseContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImmReleaseContext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _ASSERT
void Mint::EnableIME(bool bEnable)
{
_ASSERT(GetHWND());
if ( (bEnable == true) && MEvent::GetIMESupport()) {
if (m_hImc) {
ImmAssociateContext(GetHWND(), m_hImc);
m_hImc = NULL; // EnableIME(false) ÇÒ¶§ ´Ù½Ã ¼ÂÆõȴÙ
::SetFocus(GetHWND());
}
m_bEnableIME = true;
} else {
// HIMC¸¦ m_hImc¿¡ Àӽà º¸°üÇØ µ×´Ù°¡, Enable¶§ º¹±¸ÇÑ´Ù.
m_hImc = ImmGetContext(GetHWND());
if (m_hImc) {
ImmAssociateContext(GetHWND(), NULL);
ImmReleaseContext(GetHWND(), m_hImc);
::SetFocus(GetHWND());
}
//ImmDisableIME(0);
m_bEnableIME = false;
}
// CompositionÁßÀÎ ¹®ÀÚ¿ Á¦°Å
HIMC hImc = ImmGetContext(GetInstance()->GetHWND());
if(hImc!=NULL){
ImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
ImmReleaseContext(GetInstance()->GetHWND(), hImc);
}
}
开发者ID:MagistrAVSH,项目名称:node3d,代码行数:29,代码来源:Mint.cpp
示例2: ImeUISetConversionMode
BOOL
ImeUISetConversionMode(
HWND hwnd
)
{
PCONSOLE_TABLE ConTbl;
HIMC hIMC; // Input context handle.
LPCONIME_UIMODEINFO lpModeInfo ;
COPYDATASTRUCT CopyData ;
DWORD OldConversion ;
DBGPRINT(("CONIME: Get IMN_SETCONVERSIONMODE Message\n"));
ConTbl = SearchConsole(LastConsole);
if (ConTbl == NULL) {
DBGPRINT(("CONIME: Error! Cannot found registed Console\n"));
return FALSE;
}
hIMC = ImmGetContext( hwnd ) ;
if ( hIMC == 0 )
return FALSE;
lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ) ;
if ( lpModeInfo == NULL) {
ImmReleaseContext( hwnd, hIMC );
return FALSE;
}
OldConversion = ConTbl->dwConversion ;
ImmGetConversionStatus(hIMC,
(LPDWORD)&ConTbl->dwConversion,
(LPDWORD)&ConTbl->dwSentence) ;
CopyData.dwData = CI_CONIMEMODEINFO ;
CopyData.cbData = sizeof(CONIME_UIMODEINFO) ;
CopyData.lpData = lpModeInfo ;
if (ImeUIMakeInfoString(ConTbl,
lpModeInfo))
{
ConsoleImeSendMessage( ConTbl->hWndCon,
(WPARAM)hwnd,
(LPARAM)&CopyData
) ;
}
LocalFree( lpModeInfo );
ImmReleaseContext( hwnd, hIMC );
return TRUE ;
}
开发者ID:conioh,项目名称:os-design,代码行数:53,代码来源:consubs.c
示例3: handle
static LONG WINAPI handle(HWND win, UINT msg, WPARAM w, LPARAM l) {
LONG r;
switch (msg) {
#define HANDLE(x) case WM_##x: cvReport("han " #x); r = HANDLE_WM_##x(win, w, l, on##x); break
HANDLE(TIMER);
HANDLE(PAINT);
HANDLE(MOUSEMOVE);
HANDLE(SIZE);
HANDLE(KEYDOWN);
HANDLE(SYSKEYDOWN);
HANDLE(SYSKEYUP);
HANDLE(CHAR);
HANDLE(KEYUP);
HANDLE(LBUTTONDOWN);
HANDLE(RBUTTONDOWN);
HANDLE(MBUTTONDOWN);
HANDLE(LBUTTONUP);
HANDLE(RBUTTONUP);
HANDLE(MBUTTONUP);
HANDLE(MOUSEWHEEL);
HANDLE(DESTROY);
HANDLE(CLOSE);
#undef HANDLE
case WM_IME_STARTCOMPOSITION: {
HIMC imc = ImmGetContext(win);
COMPOSITIONFORM cf;
cf.dwStyle = CFS_POINT;
cf.ptCurrentPos.x = cvMouseX();
cf.ptCurrentPos.y = cvMouseY();
ImmSetCompositionWindow(imc, &cf);
ImmReleaseContext(win, imc);
r = 1;
}
break;
case WM_IME_COMPOSITION: {
if(l & GCS_RESULTSTR){
unsigned short str[4096];
unsigned len, i;
HIMC imc = ImmGetContext(win);
HDC dc = GetDC(win);
len = ImmGetCompositionString(imc, GCS_RESULTSTR, str, sizeof(str));
len >>= 1;
for (i = 0; i < len; i++)
wgot(win, CVE_UNICODE, str[i], 0);
ImmReleaseContext(win, imc);
chk(ReleaseDC(win, dc));
}
r = 0;
}
break;
default: r = 0;
}
开发者ID:jacereda,项目名称:glcv,代码行数:52,代码来源:npapint.c
示例4: handleCandidates
static bool handleCandidates(HWND hwnd) {
/* Obtain IME context */
HIMC imc = ImmGetContext(hwnd);
if (!imc) return false;
/* Make sure there is at least one candidate list */
DWORD count = 0;
DWORD len = ImmGetCandidateListCountW(imc, &count);
if (!count) {
ImmReleaseContext(hwnd, imc);
return false;
}
candidateIMEWindow=hwnd;
/* Read first candidate list */
CANDIDATELIST* list = (CANDIDATELIST*)malloc(len);
ImmGetCandidateList(imc, 0, list, len);
ImmReleaseContext(hwnd, imc);
/* Determine candidates currently being shown */
DWORD pageEnd = list->dwPageStart + list->dwPageSize;
DWORD selection=list->dwSelection-list->dwPageStart;
if (list->dwPageSize == 0) {
pageEnd = list->dwCount;
} else if (pageEnd > list->dwCount) {
pageEnd = list->dwCount;
}
/* Concatenate currently shown candidates into a string */
WCHAR* cand_str = (WCHAR*)malloc(len);
WCHAR* ptr = cand_str;
for (DWORD n = list->dwPageStart, count = 0; n < pageEnd; ++n) {
DWORD offset = list->dwOffset[n];
WCHAR* cand = (WCHAR*)(((char*)list) + offset);
size_t clen = wcslen(cand);
if (!clen) continue;
CopyMemory(ptr, cand, (clen + 1) * sizeof(WCHAR));
if ((n + 1) < pageEnd) ptr[clen] = '\n';
ptr += (clen + 1);
++count;
}
HKL kbd_layout = GetKeyboardLayout(0);
WCHAR filename[MAX_PATH + 1]={0};
ImmGetIMEFileNameW(kbd_layout, filename, MAX_PATH);
if(cand_str&&wcslen(cand_str)>0) {
nvdaControllerInternal_inputCandidateListUpdate(cand_str,selection,filename);
}
/* Clean up */
free(cand_str);
free(list);
return (count > 0);
}
开发者ID:KarishmaChanglani,项目名称:nvda,代码行数:51,代码来源:ime.cpp
示例5: test_ImmMessages
static void test_ImmMessages(void)
{
CANDIDATEFORM cf;
imm_msgs *msg;
HWND defwnd;
HIMC imc;
UINT idx = 0;
HWND hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
240, 120, NULL, NULL, GetModuleHandle(0), NULL);
ShowWindow(hwnd, SW_SHOWNORMAL);
defwnd = ImmGetDefaultIMEWnd(hwnd);
imc = ImmGetContext(hwnd);
ImmSetOpenStatus(imc, TRUE);
msg_spy_flush_msgs();
SendMessage(defwnd, WM_IME_CONTROL, IMC_GETCANDIDATEPOS, (LPARAM)&cf );
do
{
msg = msg_spy_find_next_msg(WM_IME_CONTROL,&idx);
if (msg) ok(!msg->post, "Message should not be posted\n");
} while (msg);
msg_spy_flush_msgs();
ImmSetOpenStatus(imc, FALSE);
ImmReleaseContext(hwnd, imc);
DestroyWindow(hwnd);
}
开发者ID:krofna,项目名称:wine,代码行数:29,代码来源:imm32.c
示例6: test_ImmSetCompositionString
static void test_ImmSetCompositionString(void)
{
HIMC imc;
BOOL ret;
SetLastError(0xdeadbeef);
imc = ImmGetContext(hwnd);
ok(imc != 0, "ImmGetContext() failed. Last error: %u\n", GetLastError());
if (!imc)
return;
ret = ImmSetCompositionStringW(imc, SCS_SETSTR, NULL, 0, NULL, 0);
ok(broken(!ret) ||
ret, /* Vista+ */
"ImmSetCompositionStringW() failed.\n");
ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGEATTR,
NULL, 0, NULL, 0);
ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGECLAUSE,
NULL, 0, NULL, 0);
ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
ret = ImmSetCompositionStringW(imc, SCS_CHANGEATTR | SCS_CHANGECLAUSE,
NULL, 0, NULL, 0);
ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGEATTR | SCS_CHANGECLAUSE,
NULL, 0, NULL, 0);
ok(!ret, "ImmSetCompositionStringW() succeeded.\n");
ImmReleaseContext(hwnd, imc);
}
开发者ID:krofna,项目名称:wine,代码行数:34,代码来源:imm32.c
示例7: imedel
void imedel(){
//imeをオフ
HIMC hImc;
hImc = ImmGetContext( hWnd );
ImmSetOpenStatus(hImc, false);
ImmReleaseContext(hWnd, hImc);
}
开发者ID:tskkn0105,项目名称:sankakusan,代码行数:7,代码来源:tweet.cpp
示例8: ui_ime_get_state
static int
ui_ime_get_state(lua_State* L)
{
HWND hwnd;
HIMC himc;
DWORD conversion;
DWORD sentence;
hwnd = GetForegroundWindow();
himc = ImmGetContext(hwnd);
ImmGetConversionStatus(himc, &conversion, &sentence);
Crj_BuildValues(L, "{Qll}",
ImmGetOpenStatus(himc),
conversion,
sentence);
char text[256];
sprintf(text, "[%p] [%d] [%lx] [%lx]",
(void*)hwnd,
ImmGetOpenStatus(himc),
conversion,
sentence
);
MessageBox(NULL, text, "cereja", MB_OK);
ImmReleaseContext(hwnd, himc);
return 1;
}
开发者ID:emonkak,项目名称:cereja,代码行数:29,代码来源:ime.c
示例9: funcSetImeString
// &SetImeString
static void funcSetImeString(HWND i_hwnd, int i_size)
{
_TCHAR *buf = new _TCHAR(i_size);
DWORD len = 0;
_TCHAR ImeDesc[GANA_MAX_ATOM_LENGTH];
UINT ImeDescLen;
DWORD error;
DWORD denom = 1;
HANDLE hPipe
= CreateFile(addSessionId(HOOK_PIPE_NAME).c_str(), GENERIC_READ,
FILE_SHARE_READ, (SECURITY_ATTRIBUTES *)NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, (HANDLE)NULL);
error = ReadFile(hPipe, buf, i_size, &len, NULL);
CloseHandle(hPipe);
ImeDescLen = ImmGetDescription(GetKeyboardLayout(0),
ImeDesc, sizeof(ImeDesc));
if (_tcsncmp(ImeDesc, _T("SKKIME"), ImeDescLen) > 0)
denom = sizeof(_TCHAR);
HIMC hIMC = ImmGetContext(i_hwnd);
if (hIMC == INVALID_HANDLE_VALUE)
return;
int status = ImmGetOpenStatus(hIMC);
ImmSetCompositionString(hIMC, SCS_SETSTR, buf, len / denom, NULL, 0);
delete buf;
ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
if (!status)
ImmSetOpenStatus(hIMC, status);
ImmReleaseContext(i_hwnd, hIMC);
}
开发者ID:byplayer,项目名称:yamy,代码行数:33,代码来源:hook.cpp
示例10: GetClientRect
LRESULT CWkeWebkitWnd::OnImeStartComposition(UINT uMsg, WPARAM wParam,LPARAM lParam, BOOL& bHandled)
{
wkeRect caret = m_pWebView->getCaret();
RECT rcClient;
GetClientRect(m_hWnd, &rcClient);
CANDIDATEFORM form;
form.dwIndex = 0;
form.dwStyle = CFS_EXCLUDE;
form.ptCurrentPos.x = caret.x + rcClient.left;
form.ptCurrentPos.y = caret.y + caret.h + rcClient.top;
form.rcArea.top = caret.y + rcClient.top;
form.rcArea.bottom = caret.y + caret.h + rcClient.top;
form.rcArea.left = caret.x + rcClient.left;
form.rcArea.right = caret.x + caret.w + rcClient.left;
COMPOSITIONFORM compForm;
compForm.ptCurrentPos=form.ptCurrentPos;
compForm.rcArea=form.rcArea;
compForm.dwStyle=CFS_POINT;
HWND hWnd=m_pOwner->GetManager()->GetPaintWindow();
HIMC hIMC = ImmGetContext(hWnd);
ImmSetCandidateWindow(hIMC, &form);
ImmSetCompositionWindow(hIMC,&compForm);
ImmReleaseContext(hWnd, hIMC);
//bHandled = TRUE;
return 0;
}
开发者ID:yz254316702,项目名称:DuiLib_OwenYi,代码行数:30,代码来源:WkeWebkit.cpp
示例11: GetClient
LRESULT CDuiWkeWebkit::OnImeStartComposition( UINT uMsg, WPARAM wParam,LPARAM lParam )
{
wkeRect caret = m_pWebView->getCaret();
CRect rcClient;
GetClient(&rcClient);
CANDIDATEFORM form;
form.dwIndex = 0;
form.dwStyle = CFS_EXCLUDE;
form.ptCurrentPos.x = caret.x + rcClient.left;
form.ptCurrentPos.y = caret.y + caret.h + rcClient.top;
form.rcArea.top = caret.y + rcClient.top;
form.rcArea.bottom = caret.y + caret.h + rcClient.top;
form.rcArea.left = caret.x + rcClient.left;
form.rcArea.right = caret.x + caret.w + rcClient.left;
COMPOSITIONFORM compForm;
compForm.ptCurrentPos=form.ptCurrentPos;
compForm.rcArea=form.rcArea;
compForm.dwStyle=CFS_POINT;
HWND hWnd=GetContainer()->GetHostHwnd();
HIMC hIMC = ImmGetContext(hWnd);
ImmSetCandidateWindow(hIMC, &form);
ImmSetCompositionWindow(hIMC,&compForm);
ImmReleaseContext(hWnd, hIMC);
return 0;
}
开发者ID:Johnny-Martin,项目名称:ComBase,代码行数:28,代码来源:DuiWkeWebkit.cpp
示例12: GetNLSMode
DWORD
GetNLSMode(
HWND hWnd,
HANDLE hConsole
)
{
PCONSOLE_TABLE ConTbl;
HIMC hIMC;
ConTbl = SearchConsole(hConsole);
if (ConTbl == NULL) {
DBGPRINT(("CONIME: Error! Cannot found registed Console\n"));
return 0;
}
hIMC = ImmGetContext( hWnd ) ;
if ( hIMC == (HIMC)NULL )
return IME_CMODE_DISABLE;
ImmGetConversionStatus(hIMC,
&ConTbl->dwConversion,
&ConTbl->dwSentence);
ConTbl->fOpen = GetOpenStatusByCodepage( hIMC, ConTbl ) ;
ImmReleaseContext( hWnd, hIMC );
return ((ConTbl->fOpen ? IME_CMODE_OPEN : 0) + ConTbl->dwConversion);
}
开发者ID:conioh,项目名称:os-design,代码行数:29,代码来源:consubs.c
示例13: SetCandidatePos
/** Set the position of the candidate window. */
static void SetCandidatePos(HWND hwnd)
{
HIMC hIMC = ImmGetContext(hwnd);
if (hIMC != NULL) {
CANDIDATEFORM cf;
cf.dwIndex = 0;
cf.dwStyle = CFS_EXCLUDE;
if (EditBoxInGlobalFocus()) {
Point pt = _focused_window->GetCaretPosition();
cf.ptCurrentPos.x = _focused_window->left + pt.x;
cf.ptCurrentPos.y = _focused_window->top + pt.y;
if (_focused_window->window_class == WC_CONSOLE) {
cf.rcArea.left = _focused_window->left;
cf.rcArea.top = _focused_window->top;
cf.rcArea.right = _focused_window->left + _focused_window->width;
cf.rcArea.bottom = _focused_window->top + _focused_window->height;
} else {
cf.rcArea.left = _focused_window->left + _focused_window->nested_focus->pos_x;
cf.rcArea.top = _focused_window->top + _focused_window->nested_focus->pos_y;
cf.rcArea.right = cf.rcArea.left + _focused_window->nested_focus->current_x;
cf.rcArea.bottom = cf.rcArea.top + _focused_window->nested_focus->current_y;
}
} else {
cf.ptCurrentPos.x = 0;
cf.ptCurrentPos.y = 0;
SetRectEmpty(&cf.rcArea);
}
ImmSetCandidateWindow(hIMC, &cf);
}
ImmReleaseContext(hwnd, hIMC);
}
开发者ID:xno,项目名称:openttd-cargodist,代码行数:33,代码来源:win32_v.cpp
示例14: CreateTBar
BOOL CreateTBar(HWND hWnd)
{
HIMC hIMC = NULL;
BOOL fOpen;
hWndToolBar = CreateToolbarEx(hWnd,
WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS,
TOOLBAR_ID,
NUMIMAGES,
hInst,
IDB_BMP,
tbButton,
sizeof(tbButton)/sizeof(TBBUTTON),
BUTTONWIDTH,
BUTTONHEIGHT,
IMAGEWIDTH,
IMAGEHEIGHT,
sizeof(TBBUTTON));
UpdateShowCandButton();
hIMC = ImmGetContext(hWndCompStr);
fOpen = ImmGetOpenStatus(hIMC);
UpdateShowOpenStatusButton(fOpen);
ImmReleaseContext(hWndCompStr,hIMC);
return (hWndToolBar != 0);
}
开发者ID:dbremner,项目名称:Windows-classic-samples,代码行数:28,代码来源:ToolBar.c
示例15: pymImmReleaseContext
BOOL pymImmReleaseContext(HWND hWnd, HIMC hIMC) {
PyMFC_PROLOGUE(pymFormatMessage);
{
PyMFCLeavePython lp;
return ImmReleaseContext(hWnd, hIMC);
}
PyMFC_EPILOGUE(0);
}
开发者ID:atsuoishimoto,项目名称:pymfc,代码行数:8,代码来源:pymwin32funcs.cpp
示例16: ImmGetContext
void JIme::ResetComposition()
{
HWND hWnd = JMain::GetInstance().GetJWindow().GetWindowHandle();
HIMC hImc = ImmGetContext(hWnd);
ImmSetCompositionString(hImc, SCS_SETSTR, NULL, 0, NULL, 0);
ImmReleaseContext(hWnd, hImc);
ZeroMemory(&ime_comp_char, 3*sizeof(TCHAR));
}
开发者ID:Rinirihiriro,项目名称:SmallPlanet,代码行数:8,代码来源:JIme.cpp
示例17: ImmGetContext
void CTextInputCtrl::SetCompositionFont()
{
HIMC himc = ImmGetContext(_hwnd);
if (himc)
{
ImmSetCompositionFont(himc, &_lfCurrentFont);
}
ImmReleaseContext(_hwnd, himc);
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:9,代码来源:TextInputCtrl.cpp
示例18: IME_getCompositionString
WCHAR* IME_getCompositionString() {
HWND hwnd = GetFocus();
if (!hwnd) return NULL;
HIMC imc = ImmGetContext(hwnd);
if (!imc) return NULL;
WCHAR* comp_str = getCompositionString(imc, GCS_COMPSTR);
ImmReleaseContext(hwnd, imc);
return comp_str;
}
开发者ID:francipvb,项目名称:nvda,代码行数:9,代码来源:ime.cpp
示例19: ImmGetContext
void CTextEditor::FlushCompositionString()
{
// We flush the composition string at selection change.
HIMC himc = ImmGetContext(_hwnd);
if (himc)
{
ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
ImmReleaseContext(_hwnd, himc);
}
}
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:10,代码来源:TextEditor.cpp
示例20: imeNotifyCancelComposition
// Cancel current IME composition.
static inline void imeNotifyCancelComposition(HWND hwnd)
{
if (!hwnd) {
qWarning() << __FUNCTION__ << "called with" << hwnd;
return;
}
const HIMC himc = ImmGetContext(hwnd);
ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
ImmReleaseContext(hwnd, himc);
}
开发者ID:oneywang,项目名称:qtbase,代码行数:11,代码来源:qwindowsinputcontext.cpp
注:本文中的ImmReleaseContext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论