3

I have created a context menu using Shell Extension DLL (C++). When user clicks on any explorer folder, the newly created context menu will be displayed which has sub menus. I want to add a line separator between the sub menus

Xearinox
  • 3,224
  • 2
  • 24
  • 38
Ullan
  • 1,311
  • 8
  • 21
  • 34

2 Answers2

7

Using

InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);

works fine for me. With hMenu being the menu handle, and indexMenu as the menu item index to insert.

Stefan
  • 43,293
  • 10
  • 75
  • 117
2

When you add the item in response to QueryContextMenu use InsertMenuItem with the MFT_SEPARATOR flag.

Alex K.
  • 171,639
  • 30
  • 264
  • 288