OS/2 codes: How to support DBCS #4 Process WM_QUERYCONVERTPOS
WM_QUERYCONVERTPOS is sent in order to query a position of a conversion window and a candiate window. However, an application is not aware of IME and not needed to control IME at all.
Let's see a syntax of WM_QUERYCONVERTPOS.
This message may return QCP_CONVERT or QCP_NOCONVERT. If you return QCP_NOCONVERT, then an window does not receive DBCS characters. That is, this has an effect to disable IME. If you return QCP_CONVERT, then an window receives DBCS characters. In this case, [pCursorPos] should be updated. [pCursorPos->xLeft] and [pCursorPos->yBottom] is a bottom-left corner of a conversion window and a upper-left corner of a candidate window. [pCursorPos->xRight] and [pCursorPos-yTop] is a upper-right corner of a conversion window. However, [pCursorPos->xRight] and [pCursorPos->yTop] seems to be ignored. And remember that each positions should be in screen coordinates. For example, if you set [pCursorPos->xLeft] and [pCursorPos->yBottom] to 0, then a conversion window will show at bottom-left corner of screen. If you apply WinMapWindowPoints() to this [pCursorPos], then a conversion window will show at bottom-left corner ofscreen a window (2016/01/04).
Here is a simple code snippet.
[mp1] is param1, [cursor] contains a current position of a cursor relative to a window. [hwnd] is a window handle.
Conversion window is a window to show characters that users is inputting.
Candidate window is a window to show candidate characters which inputted characters by users will be converted to.
Let's see a syntax of WM_QUERYCONVERTPOS.
This message is sent by an application to determine whether it is appropriate to begin conversion of DBCS characters.
param1 PRECTL pCursorPos /* Cursor position. */ param2 ULONG ulReserved /* Reserved value, should be 0. */
This message may return QCP_CONVERT or QCP_NOCONVERT. If you return QCP_NOCONVERT, then an window does not receive DBCS characters. That is, this has an effect to disable IME. If you return QCP_CONVERT, then an window receives DBCS characters. In this case, [pCursorPos] should be updated. [pCursorPos->xLeft] and [pCursorPos->yBottom] is a bottom-left corner of a conversion window and a upper-left corner of a candidate window. [pCursorPos->xRight] and [pCursorPos-yTop] is a upper-right corner of a conversion window. However, [pCursorPos->xRight] and [pCursorPos->yTop] seems to be ignored. And remember that each positions should be in screen coordinates. For example, if you set [pCursorPos->xLeft] and [pCursorPos->yBottom] to 0, then a conversion window will show at bottom-left corner of screen. If you apply WinMapWindowPoints() to this [pCursorPos], then a conversion window will show at bottom-left corner of
WinMapWindowPoints( hwnd, HWND_DESKTOP, pCursorPos, 1 );
Here is a simple code snippet.
[mp1] is param1, [cursor] contains a current position of a cursor relative to a window. [hwnd] is a window handle.
Glossary
Conversion window is a window to show characters that users is inputting.
Candidate window is a window to show candidate characters which inputted characters by users will be converted to.
댓글
댓글 쓰기