473,320 Members | 1,921 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,320 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 1261

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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.