What I really think you should do is intercept the WM_INITMENUPOPUP message
instead. That message is
there for you to intercept and edit your menu before it get's showed.
// Regards Pontus
Pontus Karlsson <ponk...@student.liu.se> wrote in message
news:elSe9tQo#GA....@cppssbbsa02.microsoft.com...
> >James Johnston <johnsto...@usa.net> wrote in message
> news:esiIKrJo#GA....@cppssbbsa02.microsoft.com...
> >Hmmm... How do I know that the user has clicked the Edit menu in the
> WM_INITMENUPOPUP message?
>
> I suggest reading the MSDN documentation about WM_INITMENUPOPUP,
>
> WM_INITMENUPOPUP
> hmenuPopup = (HMENU) wParam; // handle to submenu
> uPos = (UINT) LOWORD(lParam); // submenu item position
> fSystemMenu = (BOOL) HIWORD(lParam); // window menu flag
>
> if (uPos == 1)
> {
> // Edit menu opened, hmenuPopup = handle to submenu.
> }
OOPS i was still thinking like WM_MENUSELECT. This message only gets
triggered when the user clicks a submenu like Edit, right? Not when they
point to and/or click Undo, right?
>
>
> >When you reply, please click here. I'll recieve instant notification
about
> your reply to my newsgroup item.
>
> I'd rather not, when you post to news groups it generaly regarded as bad
> style to post in HTML.
> Especially with alot of pictures and crap, many people pay hard earned
money
> for their internet and downloading
> your message takes alot of time on a modem. Other people can't event
display
> HTML posts.
>
> Please post in plain text in the future.
sorry
>
> I also removed microsoft.public.win32.programmer.kernel because this
thread
> realy doesn't consern kernel
> issues.
>
> >James Johnston
> >E-mail: johnsto...@usa.net
>
> // Regards Pontus
>
>
>
I suggest reading the MSDN documentation about WM_INITMENUPOPUP,
WM_INITMENUPOPUP
hmenuPopup = (HMENU) wParam; // handle to submenu
uPos = (UINT) LOWORD(lParam); // submenu item position
fSystemMenu = (BOOL) HIWORD(lParam); // window menu flag
if (uPos == 1)
{
// Edit menu opened, hmenuPopup = handle to submenu.
}
>When you reply, please click here. I'll recieve instant notification about
your reply to my newsgroup item.
I'd rather not, when you post to news groups it generaly regarded as bad
style to post in HTML.
Especially with alot of pictures and crap, many people pay hard earned money
for their internet and downloading
your message takes alot of time on a modem. Other people can't event display
HTML posts.
Please post in plain text in the future.
I also removed microsoft.public.win32.programmer.kernel because this thread
James Johnston <johnsto...@usa.net> wrote in message
news:#$oyRRYo#GA....@cppssbbsa02.microsoft.com...
>
>
> Pontus Karlsson <ponk...@student.liu.se> wrote in message
> news:elSe9tQo#GA....@cppssbbsa02.microsoft.com...
> > >James Johnston <johnsto...@usa.net> wrote in message
> > news:esiIKrJo#GA....@cppssbbsa02.microsoft.com...
> > >Hmmm... How do I know that the user has clicked the Edit menu in the
> > WM_INITMENUPOPUP message?
> >
> > I suggest reading the MSDN documentation about WM_INITMENUPOPUP,
> >
> > WM_INITMENUPOPUP
> > hmenuPopup = (HMENU) wParam; // handle to submenu
> > uPos = (UINT) LOWORD(lParam); // submenu item position
> > fSystemMenu = (BOOL) HIWORD(lParam); // window menu flag
> >
> > if (uPos == 1)
> > {
> > // Edit menu opened, hmenuPopup = handle to submenu.
> > }
>
> OOPS i was still thinking like WM_MENUSELECT. This message only gets
> triggered when the user clicks a submenu like Edit, right? Not when they
> point to and/or click Undo, right?
>
Right, it get's sent *before* a submenu is displayed. That way you can
disable/enable the undo item
or any other item in the menu for that matter. When they point and click on
the undo item and
it's not disabled. You get a WM_COMMAND message.
// Regards Pontus
Pontus Karlsson <ponk...@student.liu.se> wrote in message
news:OYPO2veo#GA...@cppssbbsa02.microsoft.com...
Sorry to jump into this thread but we have a similar but different
problem w/ controlling the content of a menu.
We want to be able to enable/disable menu items but not in our own app.
We want to do this to another application like MS Word, Excel, etc.
These apps use the CommandBar object type and I see lots of examples on
how to control these objects if you are instantiating the object.
In our case we are outside of the process and need to get the reference
to the object so that we can manipulate them.
Do you have any ideas on how this can be done.
Thanks,
Bob Cochenour
Comprise Technologies
bobnj...@yours.com