Jump to content

Start MusicPlayer at headset plugin


Recommended Posts

Guest dionisys
Posted (edited)

Hey guys,

I hope someone can help me,

i'm searching for a tool which automaticly start the musicplayer,

when i connect the headset to the phone.

Is there a tool or something?

I think it shouldnt be so hard to programm.

Maybe someone can help, please.

Thanks!

I found the hard part of the code:

Imports Microsoft.WindowsMobile.Status

Public Class EventCatch

Dim headsetState As SystemState

Public Sub HeadsetForm()

InitializeComponent()

headsetState = New SystemState(SystemProperty.HeadsetPresent)

headsetState.Changed = New ChangeEventHandler(headsetState_Changed)

End Sub

Sub headsetState_Changed(ByVal sender As Object, ByVal args As ChangeEventArgs)

Dim gotHeadset As Boolean = Convert.ToBoolean(args.NewValue)

If gotHeadset Then

MessageBox.Show("Headset Present")

Else

MessageBox.Show("No Headset")

End If

End Sub

End Class

Edited by dionisys

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.