本文整理汇总了C++中ImmGetContext函数的典型用法代码示例。如果您正苦于以下问题:C++ ImmGetContext函数的具体用法?C++ ImmGetContext怎么用?C++ ImmGetContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImmGetContext函数的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: 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
示例3: test_ImmGetContext
static void test_ImmGetContext(void)
{
HIMC himc;
DWORD err;
SetLastError(0xdeadbeef);
himc = ImmGetContext((HWND)0xffffffff);
err = GetLastError();
ok(himc == NULL, "ImmGetContext succeeded\n");
ok(err == ERROR_INVALID_WINDOW_HANDLE, "got %u\n", err);
himc = ImmGetContext(hwnd);
ok(himc != NULL, "ImmGetContext failed\n");
ok(ImmReleaseContext(hwnd, himc), "ImmReleaseContext failed\n");
}
开发者ID:krofna,项目名称:wine,代码行数:15,代码来源:imm32.c
示例4: 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
示例5: 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
示例6: 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
示例7: imedel
void imedel(){
//imeをオフ
HIMC hImc;
hImc = ImmGetContext( hWnd );
ImmSetOpenStatus(hImc, false);
ImmReleaseContext(hWnd, hImc);
}
开发者ID:tskkn0105,项目名称:sankakusan,代码行数:7,代码来源:tweet.cpp
示例8: 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
示例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: 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
示例12: 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
示例13: 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
示例14: pymImmGetContext
HIMC pymImmGetContext(HWND hWnd) {
PyMFC_PROLOGUE(pymFormatMessage);
{
PyMFCLeavePython lp;
return ImmGetContext(hWnd);
}
PyMFC_EPILOGUE(0);
}
开发者ID:atsuoishimoto,项目名称:pymfc,代码行数:8,代码来源:pymwin32funcs.cpp
示例15: 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
示例16: HandleIMEComposition
/** Handle WM_IME_COMPOSITION messages. */
static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HIMC hIMC = ImmGetContext(hwnd);
if (hIMC != NULL) {
if (lParam & GCS_RESULTSTR) {
/* Read result string from the IME. */
LONG len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0); // Length is always in bytes, even in UNICODE build.
TCHAR *str = (TCHAR *)_alloca(len + sizeof(TCHAR));
len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, str, len);
str[len / sizeof(TCHAR)] = '\0';
/* Transmit text to windowing system. */
if (len > 0) {
HandleTextInput(NULL, true); // Clear marked string.
HandleTextInput(FS2OTTD(str));
}
SetCompositionPos(hwnd);
/* Don't pass the result string on to the default window proc. */
lParam &= ~(GCS_RESULTSTR | GCS_RESULTCLAUSE | GCS_RESULTREADCLAUSE | GCS_RESULTREADSTR);
}
if ((lParam & GCS_COMPSTR) && DrawIMECompositionString()) {
/* Read composition string from the IME. */
LONG len = ImmGetCompositionString(hIMC, GCS_COMPSTR, NULL, 0); // Length is always in bytes, even in UNICODE build.
TCHAR *str = (TCHAR *)_alloca(len + sizeof(TCHAR));
len = ImmGetCompositionString(hIMC, GCS_COMPSTR, str, len);
str[len / sizeof(TCHAR)] = '\0';
if (len > 0) {
static char utf8_buf[1024];
convert_from_fs(str, utf8_buf, lengthof(utf8_buf));
/* Convert caret position from bytes in the input string to a position in the UTF-8 encoded string. */
LONG caret_bytes = ImmGetCompositionString(hIMC, GCS_CURSORPOS, NULL, 0);
const char *caret = utf8_buf;
for (const TCHAR *c = str; *c != '\0' && *caret != '\0' && caret_bytes > 0; c++, caret_bytes--) {
/* Skip DBCS lead bytes or leading surrogates. */
#ifdef UNICODE
if (Utf16IsLeadSurrogate(*c)) {
#else
if (IsDBCSLeadByte(*c)) {
#endif
c++;
caret_bytes--;
}
Utf8Consume(&caret);
}
HandleTextInput(utf8_buf, true, caret);
} else {
HandleTextInput(NULL, true);
}
lParam &= ~(GCS_COMPSTR | GCS_COMPATTR | GCS_COMPCLAUSE | GCS_CURSORPOS | GCS_DELTASTART);
}
}
开发者ID:xno,项目名称:openttd-cargodist,代码行数:59,代码来源:win32_v.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_UpdateAssociation
void IME_UpdateAssociation(HWND focus)
{
ImmGetContext(focus);
if (!focus || !hSelectedFrom)
return;
ImmAssociateContext(focus,RealIMC(FROM_X11));
}
开发者ID:AmesianX,项目名称:wine,代码行数:9,代码来源:ime.c
示例19: ImmGetContext
//--------------------------------------------------------------------------
void VeWindows::_DisableIME(Window* pkWindow)
{
WindowData* pkData = (WindowData*)(VeRefObject*)pkWindow->m_spDriverData;
if(!pkData->m_hImc)
{
pkData->m_hImc = ImmGetContext(pkData->m_hWnd);
ImmAssociateContext(pkData->m_hWnd, NULL);
}
}
开发者ID:Napoleon314,项目名称:Venus2D,代码行数:10,代码来源:_VeWindows.cpp
示例20: 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
注:本文中的ImmGetContext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论