Hi,
I want to get the item of a dblookuplist to show in a statusbar or
Hint at the moment I move the cursor over the control.
I was able to do it using other controls like TListbox, TCombobox and
TDBListbox, but I can't get it to work for lookup controls.
The code I use for the other controls is:
procedure TfrmPB_Wizard.ShowComboboxItemText(sender: TObject; var
Done: Boolean);
var
pt: TPoint;
wnd: HWND;
buf: array[0..128] of Char;
i: Integer;
begin
GetCursorPos(pt);
wnd := WindowFromPoint( pt );
buf[0] := #0;
if wnd <> 0 then
begin
Getclassname( wnd, buf, sizeof(buf));
//Check if control is combobox
if StrIComp(buf, 'ComboLBox') = 0 then
begin
Windows.ScreenToClient( wnd, pt );
i:= SendMessage( wnd, LB_ITEMFROMPOINT, 0,lparam(
PointToSmallPoint(pt)));
if i >= 0 Then
begin
sendmessage( wnd, LB_GETTEXT, i, integer(@buf));
//Show in statusbar
PBStatusBar.Panels[0].text := buf;
Exit;
end;
end;
end;
//Clear statusbar
PBStatusBar.Panels[0].text := '';
end;
I call this procedure by an Application OnIdle event.
Can anybody help me to use it in a lookup control?
Thanks,
Regards,
Oliver Talens
*****************************
Abyss I.T. Solutions
Mathildastraat 36B
4901 HC Oosterhout
tel: +31 (0)162-439809
fax: +31 (0)162-439882
O.Talens@Abyss.nl
*****************************
I want to get the item of a dblookuplist to show in a statusbar or
Hint at the moment I move the cursor over the control.
I was able to do it using other controls like TListbox, TCombobox and
TDBListbox, but I can't get it to work for lookup controls.
The code I use for the other controls is:
procedure TfrmPB_Wizard.ShowComboboxItemText(sender: TObject; var
Done: Boolean);
var
pt: TPoint;
wnd: HWND;
buf: array[0..128] of Char;
i: Integer;
begin
GetCursorPos(pt);
wnd := WindowFromPoint( pt );
buf[0] := #0;
if wnd <> 0 then
begin
Getclassname( wnd, buf, sizeof(buf));
//Check if control is combobox
if StrIComp(buf, 'ComboLBox') = 0 then
begin
Windows.ScreenToClient( wnd, pt );
i:= SendMessage( wnd, LB_ITEMFROMPOINT, 0,lparam(
PointToSmallPoint(pt)));
if i >= 0 Then
begin
sendmessage( wnd, LB_GETTEXT, i, integer(@buf));
//Show in statusbar
PBStatusBar.Panels[0].text := buf;
Exit;
end;
end;
end;
//Clear statusbar
PBStatusBar.Panels[0].text := '';
end;
I call this procedure by an Application OnIdle event.
Can anybody help me to use it in a lookup control?
Thanks,
Regards,
Oliver Talens
*****************************
Abyss I.T. Solutions
Mathildastraat 36B
4901 HC Oosterhout
tel: +31 (0)162-439809
fax: +31 (0)162-439882
O.Talens@Abyss.nl
*****************************