Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disabling a Menu item - Notepad for example

Posted on 2003-12-03
7
Medium Priority
?
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:devoted2christ
ID: 9867989
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
ID: 9869328
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
ID: 9869806
Oh, ok cool; I didn't know that. You can post a question in Community Support to get your points refunded.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 29

Expert Comment

by:leonstryker
ID: 10212392
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
ID: 10217724
leonstryker,

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

  Thanks!
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10218052
Please post to the Community Support area.

Leon
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10266407
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

704 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