By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

Media Buttons

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
--------------------
From: "Devron Blatchford" <de****@auspine.com.au>
Subject: Media Buttons
Date: Tue, 4 Nov 2003 12:38:32 +1030
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eI**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 203.108.249.179
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:153360
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

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


Nov 20 '05 #2

P: n/a
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
"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:tO**************@cpmsftngxa06.phx.gbl...
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.
--------------------
From: "Devron Blatchford" <de****@auspine.com.au>
Subject: Media Buttons
Date: Tue, 4 Nov 2003 12:38:32 +1030
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eI**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 203.108.249.179
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:153360
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

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

Nov 20 '05 #3

P: n/a
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.
--------------------
From: "Devron Blatchford" <de****@auspine.com.au>
References: <eI**************@TK2MSFTNGP09.phx.gbl> <tO**************@cpmsftngxa06.phx.gbl>Subject: Re: Media Buttons
Date: Tue, 4 Nov 2003 15:35:17 +1030
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#q**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 203.108.249.179
Path: cpmsftngxa06.phx.gbl!cpmsftngxa09.phx.gbl!TK2MSFTN GP08.phx.gbl!TK2MSFTNGP09.
phx.gblXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:153377
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

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. Theevents you describe below only fire (I think) if the media play AXcontrol isembeded 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
"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:tO**************@cpmsftngxa06.phx.gbl...
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. --------------------
>From: "Devron Blatchford" <de****@auspine.com.au>
>Subject: Media Buttons
>Date: Tue, 4 Nov 2003 12:38:32 +1030
>Lines: 9
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <eI**************@TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: 203.108.249.179
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:153360
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb
>
>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
>
>
>



Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.