Microsoft KB Archive/49568

PRB: Issuing WM_DRAWITEM Message When Highlight State Changes PSS ID Number: Q49568 Article last modified on 09-11-1991 PSS database name: P_PresMan

1.21

OS/2

Summary:

SYMPTOMS In PM version 1.21, the system does not provide the correct default highlighting and unhighlighting when using an application-defined owner-draw list box that worked correctly in PM version 1.1.

CAUSE PM version 1.21 issues a WM_DRAWITEM message to OWNERDRAW list boxes when their highlight states change. However, because the interface (what the application must return) has changed somewhat from PM version 1.1, it may appear that PM has not issued a WM_DRAWITEM message. Basically, if the fsState and fsStateOld elements of the OWNERITEM structure are unequal, the application must return TRUE to get default highlighting/unhighlighting by the system. This contradicts the documentation in QuickHelp and on pages 433-434 of the “Microsoft Operating System/2 Programmer’s Reference Volume 2” for version 1.1, which states that the application should return FALSE.

STATUS Microsoft has confirmed this to be a problem in the version of QuickHelp included with OS/2 version 1.21, and on pages 433-434 of the “Microsoft Operating System/2 Programmer’s Reference Volume 2” for version 1.1. We will post new information here when the documentation has been updated to correct this error.

In the Software/Data Library is a file named LBOWNED that contains a simple example of an OWNERDRAW list box that behaves correctly under versions 1.1 and 1.21. LBOWNED utilizes this “new” way of achieving default highlighting/unhighlighting.

LBOWNED can be found in the Software/Data Library by searching on the word LBOWNED, the Q number of this article, or S12425. LBOWNED was archived using the PKware file-compression utility.

Copyright Microsoft Corporation 1991.