Win 64bit, Listview ListItems OnInfoTip not implemented? lazarus / 31-LCL ---------------------------------------------------------------------- d7_2_laz · 2021-02-08 10:18 Coming from Delphi7Win32 going to Lazarus 2.0.10 on and for Win x64, i find that TCustomListView.CNNotify does not pass resp. comments out the message LVN_GETINFOTIP. How is it foreseen to use InfoTips on Listview's ListItems? ---------------------------------------------------------------------- lucamar · 2021-02-08 12:52 You could do it through OnShowHint, I guess; it's what I do. Or do you mean something else? ---------------------------------------------------------------------- d7_2_laz · 2021-02-08 16:40 hello lucamar, thanks! With CNNotify, querying LVN_GETINFOTIP,  there was easy access to the appropriate listitem (if i remember right, it's long ago), but  that message is not resp no longer passed (with Delphi 7 it was). -- But probably you are right, OnShowHint should do the job as well. But, to which listitem the current mouse position (HintInfo^.CursorPos)  belongs to for find out the belonging info text? ---------------------------------------------------------------------- d7_2_laz · 2021-02-08 18:39 Thea latter can be nicely done with GetItemAt(x,y), so that's fine now. -However i'm staying a little bit unsure if that's the iindended approach. ---------------------------------------------------------------------- lucamar · 2021-02-08 18:50 Yes, that's how it's done. A little code example from a program which shows a list of files (in a TListBox called, logically enough, FileList) whose hint is used to show the filename (for cases where it's longer than the list object viewport): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TMainForm.ListShowHint(Sender: TObject; HintInfo: PHintInfo);{ Changes the hint to the filename the mouse pointer points to or, if none  to a generic one}var  Index: Integer;  Pos: TPoint;begin  Pos := HintInfo^.CursorPos;  Index := FileList.GetIndexAtXY(Pos.x, Pos.y);  if Index >= 0 then    HintInfo^.HintStr := FileList.Items[Index]  else    HintInfo^.HintStr := sDefaultListHint;end; For a TListView, instead of the combination of GetIndexAt()/Items[] you would use GetItemAt() and access the item directly, so it would be something like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TMainForm.ListShowHint(Sender: TObject; HintInfo: PHintInfo);var  TheItem: TListItem;  Pos: TPoint;begin  Pos := HintInfo^.CursorPos;  TheItem := ListView.GetIItemAt(Pos.x, Pos.y);  if Assigned(TheItem) then    HintInfo^.HintStr := TheItem.Caption;   else    HintInfo^.HintStr := sDefaultListHint;end; ---------------------------------------------------------------------- d7_2_laz · 2021-02-08 19:11 Hi lucamar, thanks! I did it quite the same Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TmyListview.DoOnShowHint(Sender: TObject;HintInfo: PHintInfo);var pt: TPoint; aItem: TListItem; S: String;begin      pt := HintInfo^.CursorPos;      aItem := GetItemAt(pt.x, pt.y);      if aItem = nil then exit;      S := GetInfoTip(aItem);      HintInfo^.HintStr := S;end; ---------------------------------------------------------------------- d7_2_laz · 2021-02-08 19:18 However the last remaining prob, that info tips now may appear  twice: my own one, and that one that might be send by the listview when items are truncated within a column. See: https://delphidabbler.github.io/delphi-tips/tips/158.html Tried to suppress that via: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      Style := ListView_GetExtendedListViewStyle(Handle);     ListView_SetExtendedListViewStyle(Handle, Style); But withoout any effect. -  Dikd sou encounter such too? ---------------------------------------------------------------------- lucamar · 2021-02-08 21:29 I don't use TListView very much but I suspect it might be a gimmick of the widgetset. I don't use Windows at all (except for tests) so I can't help you much with that; however I might be able to do some little tests tomorrow and, if so, I'll tell you what I find (if anything). ---------------------------------------------------------------------- d7_2_laz · 2021-02-09 09:12 Hello lucamar, that's very kind, but please don't waste time here. I'm pretty sure it is not due to Laz, but for Laz. as well as Delphi commonly inherited from Windows common controls (probably 64 bit) API und it maybe hard to find out how to flag out the behaviour (that i previously did not encounter with Delphi 7 / 32bit exe). See here: https://stackoverflow.com/questions/13773435/wrong-hint-showing-on- tlistview-with-ownerdata-and-ownerdraw-set-to-true I did a couple of quick tests and cannot confirm it depends on ownerdraw resp ownerdata usage, as it is simiply sufficient to use a simple listview, having two columns, adding one item with a text that does not fit within a column, for to see the effect. Notmally it makes sense, obviously, but not if one creates his own infotips; because  it's confusing to see two of them sometimes. However it's not so really important, and of course not a Laz. issue. ---------------------------------------------------------------------- lucamar · 2021-02-09 10:45 Does it still happen if you set the list's ToolTips property to False? ---------------------------------------------------------------------- d7_2_laz · 2021-02-09 11:49 Oh yes, it does, bingo ..  this property (why didn't i try this one ..) made the difference - thousand thanks for your attention and help, lucamar! - - ---------------------------------------------------------------------- lucamar · 2021-02-09 11:59 Glad it helped