mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 13:49:32 +02:00
win32: don't call LB_GETITEMRECT during ListBox initialization (fixes issue #0019191)
git-svn-id: trunk@30377 -
This commit is contained in:
parent
bd8eb25ea6
commit
fb02700240
@ -668,12 +668,14 @@ begin
|
||||
Result := SendMessage(ACustomListBox.Handle, LB_GETCURSEL, 0, 0);
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomListBox.GetItemRect(
|
||||
const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect
|
||||
): boolean;
|
||||
class function TWin32WSCustomListBox.GetItemRect(const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect): Boolean;
|
||||
var
|
||||
Handle: HWND;
|
||||
begin
|
||||
Result := Windows.SendMessage(ACustomListBox.Handle, LB_GETITEMRECT, Index,
|
||||
LPARAM(@ARect)) <> LB_ERR;
|
||||
Handle := ACustomListBox.Handle;
|
||||
// The check for GetProp is required because of some division error which happens
|
||||
// if call LB_GETITEMRECT on window initialization
|
||||
Result := (GetProp(Handle, 'WinControl') <> 0) and (Windows.SendMessage(Handle, LB_GETITEMRECT, Index, LPARAM(@ARect)) <> LB_ERR);
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomListBox.GetScrollWidth(const ACustomListBox: TCustomListBox): Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user