Enabling the right-click pop-up menu

xiaoxiao2021-03-06  40

Void CMYVIEW :: OnRButtondown (uint nflags, cpoint point) {cscrollview :: OnRButtondown (nflags, point);

CMenu * Menu, * popup; menu = new cmenu ();

// load menu from resource filemenu-> loadingMenu; popup = menu-> getSubmenu (0); // Item 0 is Dummy

Uint Nenable; Nenable = MF_BYCOMMAND | MF_GRAYED;

IF (Your Test) {Nenable = MF_BYCOMMAND | MF_GRAYED;

Popup-> EnableMenuItem (ID_Your_ID, Nenable);

// Display menuclienttoscreen (& points); popup-> TRACKPOPUPMENU (TPM_LEFTALIGN | TPM_RightButton, Point.x, Point.y, this); delete menu;

转载请注明原文地址:https://www.9cbs.com/read-119390.html

New Post(0)