Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How To Disable FlashPlayer (AxShockwaveFlash) Right-click ContextMenu

0.00/5 (No votes)
5 Sep 2008 1  
How to disable FlashPlayer (AxShockwaveFlash) right-click ContextMenu

Introduction

In FlashPlayer, there is always this ContextMenu which never fits the design of the flash movie.

Background

I started making a FlashGame which has multiple clients and is always up-to-date with all other clients. This is very difficulty to manage with WebRequests and Intervals, so I decided to make my FlashGame in my C# application.

The only problem was that I have a new application but with the old ContextMenu which I hate so much. So I searched for a solution on this site, but I didn't find one. Then I started searching on Google and after some dead links and unmatching code snippets, I found a .NET Visual Basic solution which is easily translated into C# and here it is.

Using the Code

Just download the project and see how it works (if it works since it's my first article).

For all those who only want to know how the code looks like, here is the core (a small core, very small core):

public class IForcePlayer : AxShockwaveFlash
{
    const int WM_RBUTTONDOWN = 0x0204;

    protected override void WndProc(ref Message m)
    {
        if (m.Msg == WM_RBUTTONDOWN)
        {
            m.Result = IntPtr.Zero;
            return;
        }
        base.WndProc(ref m);
    }
}

History

  • 5th September, 2008: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here