473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Disabling popup menu item

Hi,

I have a popup menu item on a menu that I populate with various items at
run-time (dependant on user choices). It all works nicely.

However, the update handlers are not working. I have the following code:

// In the message map
ON_UPDATE_COMMAND_UI_RANGE(WM_USER_MYPOPUP, WM_USER_MYPOPUP +
WM_USER_NUM_MYPOPUP -1, OnUpdateMyPopup)

// Lower down in he class
void CMyView::OnUpdateMyPopup(CCmdUI* pCmdUI)
{
if (pCmdUI != NULL)
{
// Trying to disable to the first entry in the list
if ((pCmdUI->m_nID - WM_USER_MYPOPUP) == 0)
{
// We actually get in here...
pCmdUI->Enable(FALSE); // This seems to have no effect,
so I try...
pCmdUI->m_pMenu->EnableMenuItem(0, MF_BYPOSITION | MF_GRAYED |
MF_DISABLED);
// ...but it doesn't work either!
}
}
}

Now when I load the application, my menu item is *not* visually disable, but
when you click it, it correctly does nothing. Why is it not visually
disabled? I also need to set a check against the last selected option, but
this is also not working.

Thanks in advance,
Alain


Jul 21 '05 #1
0 1268

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dfg | last post by:
Hi...Just a quick question about popup menus. I have a menu popup using the code below: Private Sub fraAccBal_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button...
2
by: ouech | last post by:
hi, i finally tryied with a popup menu but i have a problem. i popup it with TrackMenuPopup and i create it from a ressource. but it doesn't look as it should. i d'ont have the names of the...
0
by: Dino M. Buljubasic | last post by:
I have several context menu added to my forms. The forms are displaying items in a list view. When I click on an item in a list view, a popup context menu shows allowing me to chese between...
2
by: SamSpade | last post by:
I use to get popup events when I checked out the menu coding. That was a while ago. Something I did in the interim must have suppressed those events because I just noticed I don't get them any...
0
by: Alain Dekker | last post by:
Hi, I have a popup menu item on a menu that I populate with various items at run-time (dependant on user choices). It all works nicely. However, the update handlers are not working. I have the...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
5
by: SQACSharp | last post by:
I'm trying to automate an action in Internet Explorer.... I'm trying to click an image that open a popup menu. The html code of the iimage look like like <img blabla..OnClick="ShowMenu()"/> I...
0
by: benfly08 | last post by:
Hi, I used SWT to develop an windows application. In the application there is a dynamic created popup menu. The dynamic part is that i will pass a list of name to be a submenu of one menu item....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.