const
AutoSizeWidth = LVSCW_AUTOSIZE{_USEHEADER};in C:\lazarus\lcl\interfaces\win32\win32wscustomlistview.inc
this was done in revision 24774 by Paul and the commit message was "don't reset autosized width of listview column".
I suppose this was originally meant to use LVSCW_AUTOSIZE_USEHEADER instead of LVSCW_AUTOSIZE. I have tried to modify it and use LVSCW_AUTOSIZE_USEHEADER wherever LVSCW_AUTOSIZE is used (see attached diff) (there is another occurrence in TWin32WSCustomListView.ItemSetText where the above constant is not used (obviously forgotten to substitute it) and there it must also be set to LVSCW_AUTOSIZE_USEHEADER) and now the listview will correctly include the column header in the calculation. I can't see any "resetting" of the width or any other unwanted behavior, instead it now behaves as one would expect from it.
Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listview_autosize.diff
Type: text/x-diff
Size: 1681 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100808/eb668486/attachment.bin>
