[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Win API "EnableMenuItem"

Posted on 1998-09-17
1
Medium Priority
?
870 Views
Last Modified: 2008-02-01
I want to use "EnableMenuItem" to disable(grey) the CLOSE button on the top right corner of pkzip window. I tried "EnableMenuItem(lhMenu,6,MF_GRAYED And MF_BYPOSITION)", and nothing was disabled. In the command above, lhMenu is the menu handle,6 is position of CLOSE. Thanks for your help.
0
Comment
Question by:luming
[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
1 Comment
 

Accepted Solution

by:
purushotham earned 320 total points
ID: 1435436
dear luming,
the usage of your api correct but instead of  "and" in between MF_GRAYED and  MF_BYPOSITION  you should use "or".

You should use like this

EnableMenuItem(lhMenu,6,MF_GRAYED or  MF_BYPOSITION)"

here i have an example using word applicaton for that you to first set the references in vb for microsoft word 8.0 object library and then use this code it might be helpfull to you
place a command button on form and paste the code under it
 Dim x As Object
Dim ret As Long
Dim ret1 As Long
Set x = CreateObject("word.application")
x.Application.documents.Add
x.Visible = True
ret1 = FindWindow("OpusApp", 0)
ret = EnableMenuItem(GetSystemMenu(ret1, False), 6, MF_GRAYED Or MF_BYPOSITION)

i don't know your exact usage if you can give me actual requirement i can give you code for that.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 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