INPUTCONTEXT


typedef struct tagINPUTCONTEXT {
    HWND   hWnd;
    BOOL   fOpen;
    POINT  ptStatusWndPos;
    POINT  ptSoftKbdPos;
    DWORD  fdwConversion;
    DWORD  fdwSentence;
    union {
        LOGFONTA  A;
        LOGFONTW  W;
    } lfFont;
    COMPOSITIONFORM  cfCompForm;
    CANDIDATEFORM    cfCandForm[4];
    HIMCC  hCompStr;
    HIMCC  hCandInfo;
    HIMCC  hGuideLine
    HIMCC  hPrivate; 
    DWORD  dwNumMsgBuf;
    HIMCC  hMsgBuf;
    DWORD  fdwInit
    DWORD  dwReserve[3];
} INPUTCONTEXT;  

hWnd

Handle of window that uses the input context. If the input context is shared, this must be the handle of the active window and will be reset by ImmSetActiveContext.

fOpen

Present status of the opened or closed IME.

ptStatusWndPos

Position of the status window.

ptSoftKbdPos

Position of the soft keyboard.

fdwConversion

Conversion mode used by the IME composition engine.

fdwSentence

Sentence mode used by the IME composition engine.

lfFont

LOGFONT structure used by the IME user interface to draw the composition string.

cfCompForm

COMPOSITIONFORM structure used by the IME user interface to create the composition window.

cfCandForm[4]

CANDIDATEFORM structures used by the IME user interface to create the candidate windows. This IMC supports 4 candidate forms.

hCompStr

Memory handle that points to the COMPOSITIONSTR structure. This handle is available when there is the composition string.

hCandInfo

Handle of a memory block that contains the CANDIDATEINFO structure and CANDIDATELIST structures. This handle is available when there are the candidate strings.

hGuideLine

Handle of a memory block that contains the GUIDELINE structure. This handle is available when there is the guideline information.

hPrivate

Handle of a memory block used by IME for its private date area.

dwNumMsgBuf

Number of messages stored in hMsgBuf.

hMsgBuf

Handle of the memory block that stores the messages. The format of this memory block is [Message1] [wParam1] [lParam1] {[Message2] [wParam2] [lParam2]{...{...{...}}}}. All values are double words.

fdwInit

Initialize flag. When IME initializes the members of the INPUTCONTEXT structure, IME must set the bits of the member indicated by this flag. It can be a combination of the following values:

The bit of fdwInit

Description

INIT_STATUSWNDPOS

Initialized ptStatusWndPos

INIT_CONVERSION

Initialized fdwConversion

INIT_SENTENCE

Initialized fdwSentence

INIT_LOGFONT

Initialized lfFont

INIT_COMPFORM

Initialized cfCompForm

INIT_SOFTKBDPOS

initialized ptSoftKbdPos


dwReserve[3]

Reserved; must be zero.

When calling ImeToAsciiEx, IME can generate the messages into the lpdwTransKey buffer, but when IME needs generate the messages to the applications out of ImeToAsciiEx, IME can store the messages in hMsgBuf and call ImmGenerateMessage, which sends the messages in hMsgBuf to the application.