79123582

Date: 2024-10-24 20:58:54
Score: 0.5
Natty:
Report link

I just found out how to get the icons for these items.

This is the MENUITEMINFO structure:

<StructLayout(LayoutKind.Sequential)>
Public Structure MENUITEMINFO
    Public cbSize As UInteger
    Public fMask As UInteger
    Public fType As UInteger
    Public fState As MFS
    Public wID As Integer
    Public hSubMenu As IntPtr
    Public hbmpChecked As IntPtr
    Public hbmpUnchecked As IntPtr
    Public dwItemData As IntPtr
    Public dwTypeData As String
    Public cch As UInteger
    Public hbmpItem As IntPtr
End Structure

I just found out it has 3 icons inside: hbmpItem (the only one I was checking at first), but also hbmpChecked and hbmpUnchecked. Apparently some context menu handlers use hbmpUnchecked instead of hbmpItem. I found this in the sources of the 7-zip context menu handler.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: miss programmer