I am currently using the following function to detect special button presses (Play, Stop, Pause) on my MCE remote.
Private Const WM_APPCOMMAND As Integer = &H319
Public Function WndProc(hwnd As IntPtr, msg As Integer, wParam As IntPtr, lParam As IntPtr, ByRef handled As Boolean) As IntPtr
If msg = WM_APPCOMMAND Then
Dim cmd As Integer = CInt(CUInt(lParam) >> 16 And Not &HF000)
Select Case cmd
Case 13 'Stop
'Some Code
Exit Select
Case 47 'Pause
'Some Code
Exit Select
Case 46 'Play
'Some Code
Exit Select
End Select
handled = True
End If
Return IntPtr.Zero
End Function
I would also like the functionality of using the colored buttons as well however when they are pressed, they do not seem to return anything for cmd.
Is there a way i can achieve this functionality?