Disabling a Menu item - Notepad for example

Hi Guys,

  How do I enable/disable a menu item using API?

  For example, I open Notepad application, run my program,
and then when I click the File menu (of Notepad), the New menu item is disabled.

  Is that possible?  
  Thanks!

wuttrain
LVL 2
wuttrainAsked:
Who is Participating?
 
SpazMODicConnect With a Mentor Commented:
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0
 
devoted2christCommented:
I think that would depend a lot on the program. Some programs control their menu by populating it from registry values, while others store the information internally (just create a VB6 app with a menu and you'll see what I'm talking about). If it's just one program you're trying to do this to, then it may be possible, but for the most part it's going to be a very difficult chore...
0
 
wuttrainAuthor Commented:
devoted2christ,

thanks for the comments.  but i think i got the code i needed.

  lHwnd = GetHWND("Point -*", "*", "Send Menu Command - Import")
  hMainMenu = GetMenu(lHwnd)
  hMenu = GetSubMenu(hMainMenu, 0) 'get into the File Menu 0
 
  lRet = ModifyMenu(hMainMenu, 6, MF_BYPOSITION Or MF_GRAYED, 2, "&Lenders")
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
GenericUserNameCommented:
Oh, ok cool; I didn't know that. You can post a question in Community Support to get your points refunded.
0
 
leonstrykerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/Refund
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

leonstryker
EE Cleanup Volunteer
0
 
wuttrainAuthor Commented:
leonstryker,

  I would like to have a refund for this question.  What should I do?

  Thanks!
0
 
leonstrykerCommented:
Please post to the Community Support area.

Leon
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.