SendMessage working with ListBox (OpenInsight 32-bit Specific)
At 24 FEB 2004 04:37:49PM Kevin Bolitho wrote:
I am trying to determine the row height of a listbox
I see in the Borland Windows.H file "#define LB_GETITEMHEIGHT (WM_USER+34)"
This is what I am trying to do…
hWnd=Get_Property(BubCtrl,"HANDLE")
RowHeight=SendMessage(hWnd,1058,1,0) ;* 1058=1024 + 34
Result is
hWnd is returned with a number that looks resonable.
RowHeight is always returned as 0 rather than the number of pixels.
If anyone else has done this then my error may be obvious.
Thanks for responses in advance.
At 24 FEB 2004 07:38PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Kevin,
Was that a 16 bit windows.h file perchance?
The Win32 header files state:
#define LB_GETITEMHEIGHT 0x01A1
Which returns the correct value when used with SendMessage on my OI system. Basically MS changed a lot of message IDs in Win32 so make sure you have the correct headers…
World leaders in all things RevSoft
At 24 FEB 2004 11:00PM Pat McNerthney wrote:
Kevin,
The documentation on here on LB_GETITEMHEIGHT says the following about the wParam parameter (the third parameter of SendMessage):
"Specifies the zero-based index of the list box item. This index is used only if the list box has the LBS_OWNERDRAWVARIABLE style; otherwise, it must be zero."
Your code is passing one in this parameter.
Pat