469,592 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Get notification of user clicking on menu item

Hey all,

I've had to dive down into unmanaged world from .NET recently to
subclass the IE browser window for the purposes of adding menu items.
I've gotten the items added thanks to the Win32 API "InsertMenu" call,
but they don't do anything.

The problem is, I don't own the menu, so I don't process the result
codes that are returned from TrackPopupMenu (or TrackPopupMenuEx). I
don't know if IE uses the IContextMenu mechanism that the Windows
Shell does, but I doubt it. So without having to reimplement the
browser's ShowContextMenu function (which would be a bit of a hack,
most likely), how can I get my menu items to do what I want?

I tried looking for windows messages raised when a menu item is
clicked, but it doesn't look like there are any. I see a
WM_MENUSELECT, and then I see WM_UNINITMENUPOPUP, but nothing to
indicate that the item was actually clicked on.

Is there a (relatively) easy way I can specify a function to be called
when someone clicks on my menu item if I'm not the one calling
TrackPopupMenu?

Thanks,
Nathan

Apr 4 '07 #1
2 1756
Nathan,

Are you doing this for a control that is in your application (meaning
you are hosting the window), or are you doing this to an already existing IE
window?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan Baker" <na*****@vt.eduwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
Hey all,

I've had to dive down into unmanaged world from .NET recently to
subclass the IE browser window for the purposes of adding menu items.
I've gotten the items added thanks to the Win32 API "InsertMenu" call,
but they don't do anything.

The problem is, I don't own the menu, so I don't process the result
codes that are returned from TrackPopupMenu (or TrackPopupMenuEx). I
don't know if IE uses the IContextMenu mechanism that the Windows
Shell does, but I doubt it. So without having to reimplement the
browser's ShowContextMenu function (which would be a bit of a hack,
most likely), how can I get my menu items to do what I want?

I tried looking for windows messages raised when a menu item is
clicked, but it doesn't look like there are any. I see a
WM_MENUSELECT, and then I see WM_UNINITMENUPOPUP, but nothing to
indicate that the item was actually clicked on.

Is there a (relatively) easy way I can specify a function to be called
when someone clicks on my menu item if I'm not the one calling
TrackPopupMenu?

Thanks,
Nathan

Apr 4 '07 #2
On Apr 4, 4:36 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Nathan,

Are you doing this for a control that is in your application (meaning
you are hosting the window), or are you doing this to an already existing IE
window?
Nicholas,

I am doing this in an already existing IE window, which makes it more
complicated.

Thanks for the reply.

Nathan

Apr 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dan Brussee | last post: by
reply views Thread by David Hubbard | last post: by
3 posts views Thread by poolieweb | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.