Hi .. I need to activate and deactivate Menubar and Toolbar time to time.
I have written code :

CWnd * pFrame = (CWnd *)AfxGetMainWnd();
CMenu * menu = pFrame->GetMenu();

for (int mq = 0;mq < menu->GetMenuItemCount();mq++)
menu->EnableMenuItem(mq,MF_BYPOSITION|MF_GRAYED);

pFrame->DrawMenuBar();

I just change attibute MF_GRAYED to MF_ENABLED as required.

This works fine with MenuBar but there is a problem with ToolBar .

Toolbar Enable/Disable doesnot happen properly.

PL Guide

Thanking you ...