Ejemplo n.º 1
0
BOOL MakeResultString( HIMC hIMC,BOOL fFlag)
{
    GENEMSG GnMsg;
    LPCOMPOSITIONSTRING lpCompStr;
    LPINPUTCONTEXT lpIMC;
	LPTSTR lpConvStr,lpPreResultStr;
	LPCANDIDATEINFO lpCandInfo;
	LPCANDIDATELIST lpCandList;
/*
    if (!IsCompStr(hIMC))
        return FALSE;
*/	
	wConversionMode = 0;
	dwCurPhraseAttrib=0;

    lpIMC = ImmLockIMC(hIMC);
    lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
	lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
	lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo  + lpCandInfo->dwOffset[0]);

	if(fFlag) {
		lpConvStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szConvCompStr;
		lpPreResultStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szPreResultStr;
		_tcscpy(lpPreResultStr,lpConvStr);

		if(wConversionSet & CONVERSION_SET_BIG5) gb2big(lpConvStr);

		_tcscpy(GETLPRESULTSTR(lpCompStr),lpConvStr);
		
		lpCompStr->dwResultStrLen = _tcslen(lpConvStr);
	}
	else{
		*GETLPRESULTSTR(lpCompStr) = _T('\0');
		lpCompStr->dwResultStrLen = 0;
	}

	lpCandList->dwCount = 0;
    lpCompStr->dwCompStrLen = 0;

	_tcscpy(GETLPCANDSTR(lpCandList,0),_T(""));
	_tcscpy(GETLPCANDSTR(lpCandList,1),_T(""));
	
	ImmUnlockIMCC(lpIMC->hCompStr);
	ImmUnlockIMCC(lpIMC->hCandInfo);
	
	GnMsg.msg = WM_IME_COMPOSITION;
	GnMsg.wParam = 0;
	GnMsg.lParam = GCS_RESULTSTR;
	GenerateMessage(hIMC, lpdwCurTransKey,(LPGENEMSG)&GnMsg);
	
	GnMsg.msg = WM_IME_ENDCOMPOSITION;
	GnMsg.wParam = 0;
	GnMsg.lParam = 0;
	GenerateMessage(hIMC, lpdwCurTransKey,(LPGENEMSG)&GnMsg);
	
    ImmUnlockIMC(hIMC);
    return TRUE;
}
Ejemplo n.º 2
0
Archivo: newio.c Proyecto: zhouqt/kbs
void oflush()
{
    if (obufsize) {
        if (convcode) {
            char *out;

            out = gb2big(outbuf, &obufsize, 0, getSession());
#ifdef SSHBBS
            if (ssh_write(0, out, obufsize) < 0)
#else
            if (write(0, out, obufsize) < 0)
#endif
                abort_bbs(0);
        } else
#ifdef SSHBBS
            if (ssh_write(0, outbuf, obufsize) < 0)
#else
            if (write(0, outbuf, obufsize) < 0)
#endif
                abort_bbs(0);
    }
    obufsize = 0;
}