473,320 Members | 1,828 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.

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 1846
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sonic | last post by:
I have an MDE file that is growing exponentially (from 3,900 KB to over 132,000 KB today). I am not saving data in this MDE, although I use a mix of offline and SQL tables for Read Only querying. ...
3
by: Jigar Mehta | last post by:
Hye, This is Jigar mehta from India. I have made one application that adds dynamic menu items from the database. Each menu item has one ID and menu item's text is coming from the database. Now, I...
1
by: Dan Brussee | last post by:
I know, of course that client side stuff cant call server code directly. What I am doing is putting in a basic LeftHand menu bar using a user control that contains a datagrid composed of linkbutton...
0
by: David Hubbard | last post by:
I am running asp.net 2.0 and when I create either a vertical or horizontal menu and click the menu item it opens a new browser window with the page selected in the menu item. I am using...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
0
by: John Smith | last post by:
I still have not gotten this damn thing figured out and I'm asking for help one last time before I give up on it. I have a user control that contains a paged gridview control. The master page...
3
by: poolieweb | last post by:
I have created a custom user control which creates a ASPxMenu ( Same fucntion as standard menu control) from data retreved from a webservice (Reporting Services) which deals with user access. This...
0
by: Petra | last post by:
Hi! I don't know how to handle the following problem: When a User clicks on the detail view of an item, I lock the item in the database. If the user exits with clicking the cancel or ok button...
1
by: chandan | last post by:
Hi, I am in search of a control that can save image form my webpage. On that web page I am using my own context menu and I disabled the default context menu of IE. Now I want the same...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.