Following the "classic" IContextMenu way of creating context menu shell extensions, it's possible to associate an image to each of the new custom menu items.
In fact, in IContextMenu::QueryContextMenu() implementation, it's possible to call SetMenuItemBitmaps() API to set the bitmap for the custom menu item.

Moreover, using IContextMenu3::HandleMenuMsg2(), it's possible to respond to WM_MEASUREITEM and WM_DRAWITEM shell messages, to implement some custom owner drawing.

Does the new Windows 7+ IExecuteCommand interface allow this versatility?
Using this interface, is it possible to set custom images for menu items, and do some owner drawing?

有帮助吗?

解决方案

See "Simplifying context menu extensions with IExecuteCommand". As I understand, it's not a replacement for IContextMenu et al. If you need fancy UI features available with IContextMenu, keep using it. If you don't, IExecuteCommand is easier to implement.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top