┌──────────────────────────────────────────────────────────────────────┐ │Process the WM_QUERYCONVERTPOS message to create the conversion │ │information area at the spot where the cursor is located. │ └──────────────────────────────────────────────────────────────────────┘
The WM_QUERYCONVERTPOS message is sent to the window when the end user tries to enter DBCS conversion mode. The message is sent to verify whether it is allowed to enter the conversion mode, and query the position of the conversion window. The parameters and return value of the message are as follows:
param1
The default window procedure will assume the fixed-position conversion. The pre-defined window controls handle this message according to their characteristics. For instance, the Frame Control window procedure returns QCP_NOCONVERT. On the contrary, the Entry Field Control window procedure provides the on-the-spot conversion as default. Refer to Presentation Manager Programming Guide for the detail of the behavior of each control.
Allowing on-the-spot conversion (MISC program of IBM OS/2 DBCS Application
Primer for DBCS OS/2 V2.1(DTCO-0011-2)) is an example source code to show
how the WM_QUERYCONVERTPOS message is to be treated (**).
Allowingon - the - spotconversion( MISCprogramofIBMOS / 2DBCSApplicationPrimerforDBCSOS
/ 2V2 . 1 ( DTCO - 0011 - 2 ) )
typedef struct CurPos { USHORT usCharNum; /* on which character... */ USHORT usLineNum; /* of which line ? */ POINTL ptlCursor; /* cursor position in pel */ LONG cx; /* cursor size */ LONG cy; } CURPOS; . . . MRESULT EXPENTRY editorWinProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { static BOOL flSpot = FALSE; /* indicates if on-the-spot is performed */ ... switch( msg ) { ... case WM_QUERYCONVERTPOS: { PRECTL pCurPos; pCurPos = (PRECTL)PVOIDFROMMP(mp1); if( flSpot == TRUE ) { /* set on-the-spot conversion if the flag is on */ pCurPos->xLeft = curpos.ptlCursor.x; pCurPos->yBottom = curpos.ptlCursor.y; pCurPos->xRight = 0; pCurPos->yTop = 0; } else { /* set fixed-position conversion if the flag is off */ pCurPos->xLeft = -1; pCurPos->yBottom = -1; pCurPos->xRight = 0; pCurPos->yTop = 0; } return (MRESULT)QCP_CONVERT; /* allow conversion */ } ...