Input Method Instance

Input Method Instance

Input Method Instance is a contextual unit which holds the several states related to the user input. It is actually a data block which is allocated by system. The data structure is directly accessible through a long value handle(HIMI) by calling ImRequestIMInstance, which gives IME the memory address of the structure. After IME refers to or change the IMInstance contents, IME should release IMInstance by calling ImReleaseIMInstance call. IMInstance itself has the following structure.

                IMINSTANCE
                {
                        /* Size of this structure */
                        ULONG ulSize;

                        /* Information related to the client application */
                        ULONG ulSessionType;
                        HWND hwnd;
                        ULONG ulSessionID;
                        ULONG ulClientInfo;
                        ULONG ulCodepage;

                        /* Status part */
                        HIMIP himipStatus;
                        ULONG ulInputMode;
                        ULONG ulConversionMode;
                        POINTL ptlStatusPos;
                        SIZEL slStatusSize;

                        /* Conversion part */
                        HIMIP himipConversion;
                        FATTRS faConversionWindow;
                        GRADIENTL gradlConversionWindow;
                        SIZEF sfCharBox;
                        CONVERSIONPOS cpConversionPos;

                        /* Result part */
                        HIMIP himipResult;

                        /* Candidate part */
                        HIMIP himipCandidate;
                        CANDIDATEPOS cpCandidatePos;

                        /* Information message part */
                        HIMIP himipInfoMsg;

                        /* Register word part */
                        HIMIP himipRegWord;

                        /* Private part */
                        HIMIP himipPrivate;

                                        }

where