This example adds an extra option to the context menu to close all but the first view.
SOM_Scope BOOL SOMLINK myfold_wpModifyMenu(MYFOLDER *somSelf, HWND hwndMenu, HWND hwndCnr, ULONG iPosition, ULONG ulMenuType, ULONG ulView, ULONG ulReserved) { HMODULE hmod = NULLHANDLE; zString zsPathName; /* MYFOLDERData *somThis = MYFOLDERGetData(somSelf); */ MYFOLDERMethodDebug("MYFOLDER","myfold_wpModifyMenu"); if (ulMenuType == MENU_OPENVIEWPOPUP) { /* This is a pop-up menu - add options to the menu */ hmod = _clsQueryModuleHandle(_MYFOLDER); if (hmod) { _wpInsertMenuItems( somSelf, hwndMenu, 0, hmod, ID_CLOSEVIEWSMENU, 0); } } return (parent_wpModifyMenu(somSelf, hwndMenu, hwndCnr, iPosition, ulMenuType, ulView, ulReserved)); }