background image
<< DragMouse combines | QAP_GETITEMTEXT message >>
Supporting Owner-Draw List Boxes
<< DragMouse combines | QAP_GETITEMTEXT message >>
User's Guide
533
C
A
p
p
e
n
d
i
x
C
Supporting Owner-Draw List
Boxes
An owner-draw list box is a list box that has the owner-draw style bit set. This
is distinct from a custom object that looks like a standard list box but is not.
The following procedure describes how developers can modify an application
so that SilkTest can access the text of a standard list box that is owner-draw
and that does not have the HasStrings style bit turned on. (If the HasStrings
style bit of the owner-draw list box is turned on, then you do not need to
make the modifications described here.) The procedure entails modifying
each owner-draw list box's parent window procedure so that SilkTest can
query the parent about what is in the list box.
Procedure To turn on the HasStrings style bit of the owner-draw list box:
1
Include owndraw.h, supplied with SilkTest, in your source files.
2
For each owner-draw list box, add code, such as that shown below, to its
parent's WndProc.
LONG FAR PASCAL ListParentWndProc (HWND hWnd, UINT uiMsg,WPARAM wParam,
LPARAM lParam)
{
//Use a static for the registered message number
static UINT uiMsgGetItem Text = 0;
LPGETITEMTEXTSTRUCT LpGetItemText;
USHORT usItem;
PSZ pszItemText;
//Register the QAP_GETITEMTEXT message if it is not registered
if (uiMsgGetItem Text == 0)
uiMsgGetItemText = RegisterWindowMessage("QAP_GETITEMTEXT");