For everybody who might be interested in:
Earlier i had (within topic: Dark Theme in my program?) mentioned that i had problems in my app
occuring as white flash at a treeview load. I did find a workaround here, it's fine, more or less), healing the background erasure. See:
https://forum.lazarus.freepascal.org/index.php/topic,62695.30.html (reply #43 and #44)
But i didn't know at that stage at all why exactly this issue even did occur. Occasionally, now i saw the reason why:
It's by the OnGetImageIndex, especially here by the runtime of SHGetFileInfoW when dealing with icon retrieval, just happening during the background erasure.
For to have a small test case, i found it easy to demonstrate using a ShellTreeView as an example.
Test project attached. All needed files are inside (from zamtmn's metadarkstyle repo), no package needs to be installed.
You can see by this sample how annoying the issue is. Click also on the Gif file for to see.
The test project also shows how it might be somehow circumvented a bit.
A bit, because it's still not fully convincing as all controls will eppear instantly, whereas the treeview does not, and so it feels kind of bumpy.
It's not by a flaw of one of the compoenents involved of course, it's by Windows.
Btw., suppressing WM_ERASEBKGND (treeview scope) won't have an effect.
To establish an icon thread solely for this very special matters would appear to be too much overhead.
Any clever idea how to make it more smooth would be welcome!