Supporting Owner-Draw List Boxes
Supporting Owner-Draw List
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:
Include owndraw.h, supplied with SilkTest, in your source files.
For each owner-draw list box, add code, such as that shown below, to its
LONG FAR PASCAL ListParentWndProc (HWND hWnd, UINT uiMsg,WPARAM wParam,
//Use a static for the registered message number
static UINT uiMsgGetItem Text = 0;
//Register the QAP_GETITEMTEXT message if it is not registered
if (uiMsgGetItem Text == 0)
uiMsgGetItemText = RegisterWindowMessage("QAP_GETITEMTEXT");