Two questions:

1) I am trying to use SendMessage LB_GETITEMRECT. How do I pass a pointer to a user-defined RECT structure Have tried 'ByVal lParam as Rect' and the code executes but RECT.left/right/top/bottom is always equal to 0.

2) Is there a way (using SendMessage or other - I have a handle for a listbox but not a name) to get the current font and size for a listbox.



Re: .NET Compact Framework Passing pointers to user-defined structures for SendMessage in VB .NET CF 1

Alex Yakhnin MSFT

1) You need to declare the RECT structure and pass it by reference

2) To get the size you can use the GetWindowRect API call. As for the font, it is more involved. There's the WM_GETFONT message which should return the font handle if it's different from the system font. You'd need to select the font into some device content and then call GetTextMetrics.

HTH... Alex