background image
<< Supporting Owner-Draw List Boxes | Useful Multitestcase Code Templates >>
QAP_GETITEMTEXT message
<< Supporting Owner-Draw List Boxes | Useful Multitestcase Code Templates >>
534
User's Guide
C S
UPPORTING
O
WNER
-D
RAW
L
IST
B
OXES
switch (uiMsg)
{
...
default;
//Process the QAP_GETITEMTEXT message
if (uiMsg == uiMsgGetItemText)
{
//lParam points to a LPGETITEMTEXTSTRUCT structure
lpGetItemText = (LPGETITEMTEXTSTRUCT) lParam;
//Perform the requested action
switch (lpGetItemText->Action)
{
case ODA_HASTEXT:
//Tell the QAP driver if your list box contains text
if (your list box has text)
lpGetItemText->bSuccess = TRUE;
else
lpGetItemText->bSuccess = FALSE;
break;
case ODA_GETITEMTEXT:
//Return the text for the requested list item
//(lpGetItemText->itemID is the index of the item in the
//list box -- the same number passed to LB_GETITEMDATA)
usItem = UINT (lpGetItemText->itemID);
pszItemText = <pointer to text of item[usItem]>;
strncpy (lpGetItemText->lpstrItemText, pszItemText,
lpGetItemText->nMaxItemText);
lpGetItemText->lpstrItemText[lpGetItemText->nMaxItemText-1]
= `\0';
lpGetItemText->bSuccess = TRUE;
break;
case ODA_GETITEMTEXTSIZE:
//Return the length of the requested list item
usItem = UINT (lpGetItemText->itemID);
lpGetItemText->nMaxItemText = <length of item[usItem]> + 1;
lpGetItemText->bSuccess = TRUE;
break;
...
}
}
}
}