Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7051579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:16:49+00:00 2026-05-28T03:16:49+00:00

In my democode an embeded windows media player starts to load and play a

  • 0

In my democode an embeded windows media player starts to load and play a video. The player shows no controls, all other options are the default options. So far this works.

What does not work is that not all userinteraction is stopped. For instance it is possible to change the mode to fullscreen with a doubleclick and it also is possible to get a full context with a right click.

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        axWindowsMediaPlayer1.uiMode = "none";
    }

    private void button1_Click(object sender, EventArgs e)
    {
        axWindowsMediaPlayer1.URL = @"C:\stackoverflow.mp4";
    }
}

How can i isolate the player from the user and only control the player via code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:16:50+00:00Added an answer on May 28, 2026 at 3:16 am

    A friend just helped me to solve this.

    Disabling the context menü was rather easy

    axWindowsMediaPlayer1.enableContextMenu = false;
    

    Disabling the doubleclick requires a message filter – there is already a solution on the web.

    Application.AddMessageFilter((IMessageFilter)CustomFilter(this/*Form*/, axWMP));
    

    I have rewritten my example and i am now using this code:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            axWindowsMediaPlayer1.uiMode = "none";
            axWindowsMediaPlayer1.enableContextMenu = false;
            Application.AddMessageFilter(new IgnoreMouseClickMessageFilter(this, axWindowsMediaPlayer1));
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.URL = @"C:\stackoverflow.mp4";
        }
    }
    
    class IgnoreMouseClickMessageFilter : IMessageFilter
        {
            private Control parent { get; set; }
            private Control target { get; set; }
    
            public IgnoreMouseClickMessageFilter(Control parent, Control target)
            {
                this.parent = parent;
                this.target = target;
            }
    
            public bool PreFilterMessage(ref Message messageBeforeFiltering)
            {
                const Boolean FilterTheMessageOut = true;
                const Boolean LetTheMessageThrough = false;
    
                if (IsNull(parent)) return LetTheMessageThrough;
                if (IsNull(target)) return LetTheMessageThrough;
                if (WasNotClickedOnTarget(parent, target)) return LetTheMessageThrough;
                if (MessageContainsAnyMousebutton(messageBeforeFiltering)) return FilterTheMessageOut;
                return LetTheMessageThrough;
            }
    
            private bool MessageContainsAnyMousebutton(Message message)
            {
                if (message.Msg == 0x202) return true; /* WM_LBUTTONUP*/
                if (message.Msg == 0x203) return true; /* WM_LBUTTONDBLCLK*/
                if (message.Msg == 0x204) return true; /* WM_RBUTTONDOWN */
                if (message.Msg == 0x205) return true; /* WM_RBUTTONUP */
                return false;
            }
    
            private bool WasNotClickedOnTarget(Control parent, Control target)
            {
                Control clickedOn = parent.GetChildAtPoint(Cursor.Position);
                if (IsNull(clickedOn)) return true;
                if (AreEqual(clickedOn, target)) return false;
                return true;
            }
    
            private bool AreEqual(Control controlA, Control controlB)
            {
                if (controlA == controlB) return true;
                return false;
            }
    
            private bool IsNull(Control control)
            {
                if (control == null) return true;
                return false;
            }
        }
    

    Special thanks to my unnamed friend and to “remarkpk11” from the Microsoft Developer Network Frorums.

    There are some smaller issues with the code – i dont like that the Messages are hidden from me in the first place and i also would love to get rid of the two global dependencies Cursor and Application. But as far as this question goes i consider it answered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at some demo code that shows how to use a Fragment Adapter
How do I use SwingEventMonitor to monitor mouse events in applications running in other
jquery how to addClass to all the ul.menu li:first.selection ? demo code here: http://jsfiddle.net/NkbDY/
this is my demo code : <body onload=initialize()> <script> function initialize(){ var d='adddd' $.getScript('other.js',
I am building a GPS-related application that displays the coordinates amongst other calculations. My
This demo code loops 3 times and every time appends text. What I need
New demo code: I am trying to get the captcha image from a AOL,
Take the following demo code (from the GIO answer to this question), which uses
I am trying to wrangle some demo code that runs as a console application
I have been playing with the demo code from this msdn article by Jeffrey

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.