本文整理汇总了C++中ImmReleaseContext函数的典型用法代码示例。如果您正苦于以下问题:C++ ImmReleaseContext函数的具体用法?C++ ImmReleaseContext怎么用?C++ ImmReleaseContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImmReleaseContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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 ;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例7: imedel
void imedel(){
//imeをオフ
HIMC hImc;
hImc = ImmGetContext( hWnd );
ImmSetOpenStatus(hImc, false);
ImmReleaseContext(hWnd, hImc);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例15: pymImmReleaseContext
BOOL pymImmReleaseContext(HWND hWnd, HIMC hIMC) {
PyMFC_PROLOGUE(pymFormatMessage);
{
PyMFCLeavePython lp;
return ImmReleaseContext(hWnd, hIMC);
}
PyMFC_EPILOGUE(0);
}