Solved

Disabling a Menu item - Notepad for example

Posted on 2003-12-03
7
245 Views
Last Modified: 2010-05-01
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
0
Comment
Question by:wuttrain
7 Comments
 
LVL 2

Expert Comment

by:devoted2christ
Comment Utility
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
 
LVL 2

Author Comment

by:wuttrain
Comment Utility
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
 
LVL 1

Expert Comment

by:GenericUserName
Comment Utility
Oh, ok cool; I didn't know that. You can post a question in Community Support to get your points refunded.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
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
 
LVL 2

Author Comment

by:wuttrain
Comment Utility
leonstryker,

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

  Thanks!
0
 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
Please post to the Community Support area.

Leon
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
Comment Utility
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now