每当我的AxWindowsMediaPlayer1全屏显示并点击它时,它基本上会停止我的播放器或从暂停时开始再次播放。无论如何都要禁用我的播放器上的触摸/点击?
我应该提一下,我已经添加了这个:
AxWindowsMediaPlayer1.enableContextMenu = False
AxWindowsMediaPlayer1.Ctlenabled = False
第一个禁用右键单击媒体播放器时出现的选项菜单,第二个禁用主要功能,如双击全屏,但这两个都没有解决我的小问题。
答案 0 :(得分:0)
AddHandler mpOCX.MouseMoveEvent, AddressOf doMouseMove
Private Sub doMouseMove(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_MouseMoveEvent)
OnMouseMove(New MouseEventArgs(MouseButtons.None, 0, e.fX, e.fY, 0))
End Sub
' ... not sure if these will have some effect
mpOCX.uiMode = "none"
mpOCX.Ctrlenabled = False
mpOCX.enableContextMenu = False
mpOCX.stretchToFit = True ' bonus
' ... to change the mouse cursor, override OnMouseEnter in your mpOCX object, which inherits from AxWindowsMediaPlayer:
Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
' ... again, this goes in the
Cursor = Cursors.Arrow
MyBase.OnMouseEnter(e)
End Sub
' ... also, to short-circuit keyboard messages, you will have to Override PreProcessMessage in the mpOCX class, so might as well make one.
' ... these fire for keydown for WMP shortcut keys, keyup for all regular keys, but they don't fire keyup for WMP shortcut keys. this WILL disable all navigation via keyboard in WMP, so you can't press ctrl+O for example.
Public Overrides Function PreProcessMessage(ByRef m As Message) As Boolean
Return True
'Return MyBase.PreProcessMessage(m) ' do not uncomment
End Function
' ... other methods you could Override instead are ProcessCmdKey, ProcessDialogChar, ProcessDialogKey, ProcessKeyMessage, ProcessKeyEventArgs, ProcessKeyMessage, ProcessKeyPreview, ProcessMnemonic - but it's like playing whack-a-mole...
哦对不起,我误解了你的问题,哈哈;事实上,我甚至不记得这是否会禁用鼠标点击..它看起来像它,它在我的WMP代码中,但我必须修复一些线并重建; p所以我现在无法测试,但我希望它有所帮助。
实际上,有一个MouseDownEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_MouseDownEvent)
可以让你以同样的方式处理它。我不确定我的mousemove代码用于什么,但它做了一些事情,我可以保证。可能只是触发事件来移动光标,因为消息正被发送到控件。