On 6/10/22 16:42, Dmitry Timoshkov wrote:
Zhiyi Zhang zzhang@codeweavers.com wrote:
Thanks for the review.
Also, I found LVM_SETBKIMAGE is acting a bit weird on Windows. For example, if a LVM_SETBKIMAGE message trying to set a bitmap is sent the second time. The second message returns FALSE and the background image gets reset to none(from LVM_GETBKIMAGE). I don't know if we should implement such a behavior but I would be more comfortable with some tests.
According to my testing LVM_SETBKIMAGE always returns 0.
If LVM_SETBKIMAGE for a bitmap succeeds, it does return TRUE.
Regarding calling LVM_SETBKIMAGE again with the same hbitmap I'd guess that the control first destroys previosuly assigned bitmap, and that leads to a being assigned bitmap gets destroyed. The conrol then probably verifies bitmap validity before saving it internally, and that would explain why LVM_GETBKIMAGE returns 0.
Right, this make sense. It would be nice to add a test for this. MSDN doesn't mention that the bitmap will be managed by the control after the message.
Thanks, Zhiyi