vb.netvisual-studio-2010visual-studioaxshockwaveflash

VB.NET disable right click on AxShockwaveFlash elements


I've tried to disable the built-in right click menu of the shockwave flash element in my application, but it doesn't work. Is there a way to disable it in VB? Thanks!


Solution

  • it should disable the mouse right click event:

    public partial class Form1 : Form ,IMessageFilter // after the name space
    {     
    
         private const int WM_LBUTTONDOWN = 0x0201;
    
    
    
        public Form1()
        {
            InitializeComponent();
            Application.AddMessageFilter(this);
            this.FormClosed += new FormClosedEventHandler(this.Form1_FormClosed);
        }
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.RemoveMessageFilter(this);
        }
        public bool PreFilterMessage(ref Message m)
        {
             //Filter out WM_NCRBUTTONDOWN/UP/DBLCLK
            if (m.Msg == 0xA4 || m.Msg == 0xA5 || m.Msg == 0xA6) return true;
            // Filter out WM_RBUTTONDOWN/UP/DBLCLK
            if (m.Msg == 0x204 || m.Msg == 0x205 || m.Msg == 0x206) return true;
            return false;
        }