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
Asked
Active
Viewed 3,408 times
2 Answers
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