Media Buttons

  • Thread starter Thread starter Devron Blatchford
  • Start date Start date
D

Devron Blatchford

Hi there,

Can someone tell me how I can detect media buttons (play, stop etc) in
VB.NET. KeyPress, up, down events don't seem to capture them.

Thanks
Devron
 
Hi Devron,

Do you mean the WindowsMediaplay ActiveX control?
What do you mean by capture the play or stop?
If you mean the key press on the AxWindowsMediaPlayer1, you may try to
e(AxWMPLib._WMPOCXEvents_KeyDownEvent),
if you mean the status of the windows media you may use the status of
AxWindowsMediaPlayer1.

Here is my code.
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AxWindowsMediaPlayer1.URL = "c:\intro.wmv"
AxWindowsMediaPlayer1.Ctlcontrols.play()
End Sub

Private Sub AxWindowsMediaPlayer1_KeyDownEvent(ByVal sender As Object,
ByVal e As AxWMPLib._WMPOCXEvents_KeyDownEvent) Handles
AxWindowsMediaPlayer1.KeyDownEvent
MsgBox(e.nKeyCode.ToString())
MsgBox(AxWindowsMediaPlayer1.status.ToString())
End Sub

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 
I have written my own media player interface, I wish to capture extended
keyboard keys/button. The idea being that when the user presses the KB
extended key Play > or Skip >> etc that I can respond in my application. The
events you describe below only fire (I think) if the media play AXcontrol is
embeded and visible.

Basically I am looking for an event that will fire when one of these
keys/buttons are pressed.

Am I missing something?

Thanks
Devron
 
Hi Devron,

Since Windows Form's messge works by a message window.
Usually a UI control will have a messge window, so I think you may try to
capture the KB extended key on the Form to see if they can be captured.
And I want to know what is the interface you are developing, can you
capture other message on the your interface?
So that we can isolate the problem.
I look forward to hearding from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 
Back
Top