Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem clearing Listview Header image on Vista
    primarykey
    data
    text
    <p>I'm having a problem on Vista with the Listview control, in particular setting custom icons on the header. Normally under XP or any of the previous version of Windows, if I added an icon (in C++), I could do so with the following:</p> <pre><code>HeaderItem.mask = HDI_FORMAT | HDI_IMAGE; Header_GetItem(HeaderHWND, Column, &amp;HeaderItem); TurnOn(HeaderItem.fmt, HDF_IMAGE); HeaderItem.iImage = Image; if (Header_SetItem(HeaderHWND, Column, &amp;HeaderItem) == 0) printf("Failed to set header [%d:%.8X]\n", GetLastError(), GetLastError()); </code></pre> <p>and then to remove the image, on a particular column, I could use the same process but instead of turning on the HDF_IMAGE bit, you just turn it off.</p> <p>On Vista, however, when I turn it off it doesn't seem to actually be accepting the change. So, for instance, when I start my fmt is:</p> <p>0x4000 (or basically HDF_STRING)</p> <p>I turn on the icon, and it becomes:</p> <p>0x5800 (or basically HDF_STRING | HDF_IMAGE | HDF_BITMAP_ON_RIGHT)</p> <p>I then turn it off again, but the result is:</p> <p>0x4800 (or basically HDF_STRING | HDF_IMAGE)</p> <p>I've checked, and I setting it to HDF_STRING only, but once HDF_IMAGE is set, it seems to be impossible to remove. Header_SetImage doesn't return any errors, so I'm at a loss as far as what to do. I've also tried removing the Imagelist from the control, but it still leaves the space as if there still was an image there.</p> <p>At the end of the day I need to be able to add and remove icons from the header, and when they are removed I need all the header space available again (as they were before any were displayed. Any help would be greatly appreciated - thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload