PDA

View Full Version : Removing the right-click context menu OR its items


Crunchy Cat
05-28-2007, 08:55 AM
The application I am building is a Win32 container holding an embedded browser which in turn renders UI with Flex. So its a desktop application. I am using transparency layers at the Win32 level to cut out chunks of the flext UI so the user can see what's behind it.

When someone brings up the context menu and chooses 'settings', the context menu darkens the screen and that invalidates the mask color I am using for transparency and it is UUUUUUUUUGLY.

I've googled and forum'd the hell out of this issue and tried a few resonable solutions which flat out didn't work and avoided unreasonable solutions which are far too temperamental.

So, how the hell do I get rid of the 'settings' menu item or the whole context menu?

dr_zeus
05-28-2007, 08:04 PM
I've never done it myself, so I can't share a solution, but one of my old coworkers was able to stop right-click messages from reaching the Flash Player control through the standard Win32 messaging system.

Edit: Also, only the following items may be removed from the context menu: forwardAndBack, loop, play, print, quality, rewind, save, and zoom.

Crunchy Cat
05-28-2007, 09:28 PM
Yep, I have been able to remove pretty much all menu options except settings and about. The latter I don't really care about as it doesn't interefere with my UI.

It is possible to use a Win32 WH_GETMESSAGE hook to disable right-clicking of the flash player and that gets into the realm of a temperamental solution as I don't think I can rely on the flash player being at the same location in the Win32 Z-order for future versions nor can I rely on it's Win32 class name being the same (which puts FindWindow() out of the question).

I found an impressive working solution online but it is immensly temperamental... only works for IE6. Adobe documents the swRemote="swContextMenu='false'" parameter as doing exactly what I need it to do... but it just outright does not work.

This is really frustrating. I hope someone has found a solution to this problem and can share it here.