Ullan
Ullan

Reputation: 1341

How to add a separator between context menus using shell extension dll C++

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

Upvotes: 3

Views: 3919

Answers (2)

Stefan
Stefan

Reputation: 43585

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.

Upvotes: 7

Alex K.
Alex K.

Reputation: 176016

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

Upvotes: 3

Related Questions