I have an old, old, VB6 legacy system to maintain. This system creates popup menus by calling CreatePopupMenu and InsertMenuItem. They now want the system to show dynamic color squares in these popup menu (= a color picker).
I am using the following code to create the menu items:
InsertMenuItem(hMenu, lItem, MF_BYPOSITION Or MF_OWNERDRAW, lpmii)
where lItem is the item index in hMenu, and lpmii is a MENUITEMINFO struct.
My problem is that the form in which this menu is created does not receive my WM_DRAWITEM message. I pass the window's hWnd in the call to TrackPopupMenuEx, and I subclass it using SetWindowLong.
What am I doing wrong?