using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Tango.Video.DirectShow { internal sealed class MsgOnlyWindow : NativeWindow { private readonly DirectShowPlayer _player = null; internal MsgOnlyWindow(DirectShowPlayer player) { _player = player; var cp = new CreateParams { Style = 0, ExStyle = 0, ClassStyle = 0, Caption = GetType().Name }; if (Environment.OSVersion.Platform == PlatformID.Win32NT) cp.Parent = (IntPtr)(-3); // HWND_MESSAGE CreateHandle(cp); } protected override void WndProc(ref Message m) { switch (m.Msg) { case DirectShowPlayer.WM_GRAPH_NOTIFY: if (_player != null) _player.HandleEvent(); break; } base.WndProc(ref m); } } }