Click here to Skip to main content
15,889,096 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString to char* conversion Pin
David Crow1-Jun-06 4:09
David Crow1-Jun-06 4:09 
AnswerRe: CString to char* conversion Pin
William.Wang31-May-06 23:22
William.Wang31-May-06 23:22 
QuestionHow to use c++ header file in .c file Pin
saravana pandy31-May-06 20:33
saravana pandy31-May-06 20:33 
AnswerRe: How to use c++ header file in .c file Pin
NiceNaidu31-May-06 20:37
NiceNaidu31-May-06 20:37 
GeneralRe: How to use c++ header file in .c file Pin
toxcct31-May-06 22:45
toxcct31-May-06 22:45 
AnswerRe: How to use c++ header file in .c file Pin
Sarath C31-May-06 20:41
Sarath C31-May-06 20:41 
GeneralRe: How to use c++ header file in .c file Pin
saravana pandy31-May-06 21:50
saravana pandy31-May-06 21:50 
NewsBeware the C++ implicit conversion Pin
Sarath C31-May-06 20:10
Sarath C31-May-06 20:10 
QuestionDisable menu [modified] Pin
Anu_Bala31-May-06 20:06
Anu_Bala31-May-06 20:06 
AnswerRe: Disable menu Pin
Hamid_RT31-May-06 20:14
Hamid_RT31-May-06 20:14 
GeneralRe: Disable menu Pin
Anu_Bala31-May-06 20:17
Anu_Bala31-May-06 20:17 
GeneralRe: Disable menu Pin
Sarath C31-May-06 20:18
Sarath C31-May-06 20:18 
GeneralRe: Disable menu Pin
Sarath C31-May-06 20:22
Sarath C31-May-06 20:22 
GeneralRe: Disable menu Pin
Hamid_RT31-May-06 20:24
Hamid_RT31-May-06 20:24 
AnswerRe: Disable menu [modified] Pin
Sarath C31-May-06 20:17
Sarath C31-May-06 20:17 
U should pass HMENU which points the parent menu.

e.g:
<br />
   // Get the main window's menu<br />
   CMenu* pMenu = pMain->GetMenu();<br />
   CMenu* pSubMenu = pMenu->GetSubMenu<br />
<br />
    pMenu->DeleteMenu(0, MF_BYPOSITION);<br />
    for(int i = 0; i < pSubMenu->GetMenuItemCount(); i++)<br />
    {<br />
        pSubMenu->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED);<br />
    }<br />
    DrawMenuBar();<br />
}<br />


I think u need to add MF_DISABLED flag, else it will just change the menu color to gray. it wont disable the menu item

SaRath

"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

-- modified at 2:19 Thursday 1st June, 2006
GeneralRe: Disable menu [modified] Pin
Steve Echols31-May-06 20:25
Steve Echols31-May-06 20:25 
AnswerRe: Disable menu Pin
Steve Echols31-May-06 20:17
Steve Echols31-May-06 20:17 
AnswerRe: Disable menu Pin
NiceNaidu31-May-06 20:19
NiceNaidu31-May-06 20:19 
QuestionVC++ 8 Doc tool Pin
Fernando A. Gomez F.31-May-06 19:39
Fernando A. Gomez F.31-May-06 19:39 
AnswerRe: VC++ 8 Doc tool [modified] Pin
Stephen Hewitt31-May-06 19:42
Stephen Hewitt31-May-06 19:42 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Fernando A. Gomez F.1-Jun-06 4:10
Fernando A. Gomez F.1-Jun-06 4:10 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Stephen Hewitt1-Jun-06 13:45
Stephen Hewitt1-Jun-06 13:45 
GeneralRe: VC++ 8 Doc tool [modified] Pin
Fernando A. Gomez F.1-Jun-06 13:52
Fernando A. Gomez F.1-Jun-06 13:52 
QuestionContext menu extensions Pin
Anil_vvs31-May-06 19:22
Anil_vvs31-May-06 19:22 
AnswerRe: Context menu extensions Pin
Anil_vvs31-May-06 19:26
Anil_vvs31-May-06 19:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.