On my Microsoft keyboard I have a media player play/pause button.
This button pauses both Spotify, Mediaplay etc. so it's like it broadcasts a play/pause command.
Pressing this button gives me KeyCode = MediaPlayPause in .net.
How can I send this command from .net?
I need to pause/play Spotify from my .net app.
I've tried this...
Keyboard.SendKey(Keys.MediaPlayPause)
...
Public Class Keyboard
Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32)
Public Shared Sub SendKey(ByVal key As Keys)
keybd_event(CByte(key), 0, 0, 0)
End Sub
End Class
No luck.