Programming/C++

IME 한/영 상태 전환하기

wnsrn3436 2013.02.06 13:20

아래의 두 가지 방법이 있습니다.

엮인 글: IME 한/영 상태 얻기

 

void set_language(double mode)
{
    if(hIMC=ImmGetContext(hWnd))
    {
        ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
        
        DWORD dwConv, dwSent, dwTemp;
        BOOL bRet=ImmGetConversionStatus(hIMC, &dwConv, &dwSent);
        if(bRet)
        {
            dwTemp=dwConv & ~IME_CMODE_LANGUAGE;
            if(mode==0){dwTemp |= IME_CMODE_ALPHANUMERIC;}
            else{dwTemp |= IME_CMODE_NATIVE;}
            dwConv=dwTemp;
            ImmSetConversionStatus(hIMC, dwConv, dwSent);
        }
        ImmReleaseContext(hWnd, hIMC);
    }
}

 

void ime_set_language(double mode)
{
    if(hIMC=ImmGetContext(hWnd))
    {
        ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
        
        DWORD dwConv, dwSent;
        BOOL bRet=ImmGetConversionStatus(hIMC, &dwConv, &dwSent);
        if(bRet)
        {
            ImmSetConversionStatus(hIMC, mode, dwSent);
        }
        ImmReleaseContext(hWnd, hIMC);
    }
}
Tag
0 Comments
Prev 1 2 3 4 5 6 7 8 Next