Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Command name:
- <media_options> track
- ' <media_options> list values:
- last
- mute
- next
- pause
- play
- previous
- skip
- stop
- ' The script:
- Declare Function keybd_event Lib "user32.dll" (ByVal vKey As Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
- Const VK_MEDIA_PLAY_PAUSE = &hB3 ' Play/Pause Media key
- Const VK_MEDIA_NEXT_TRACK = &hB0 ' Next Track key
- Const VK_MEDIA_PREV_TRACK = &hB1 ' Previous Track key
- Const VK_MEDIA_STOP = &hB2 ' Stop Media key
- Const VK_VOLUME_MUTE = &hAD ' Volume Mute key
- Sub Main
- Select Case ListVar1
- Case "play", "pause"
- button = VK_MEDIA_PLAY_PAUSE
- Case "next", "skip"
- button = VK_MEDIA_NEXT_TRACK
- Case "previous", "last"
- button = VK_MEDIA_PREV_TRACK
- Case "stop"
- button = VK_MEDIA_STOP
- Case "mute"
- button = VK_VOLUME_MUTE
- End Select
- 'Hold down the key
- keybd_event(button,0,0,0)
- Wait 0.1
- 'Release the key
- keybd_event(button,0,2,0)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement