How do you change the focused window with java? I want to press a button to pause and start my Spotify music. Since i found there is no way to controls system volume, i found Spotify has shortcuts which can be use to pause and start music.The VBs code below doesn't work:
Dim ObjShell :Set ObjShell = CreateObject("Wscript.Shell")
ObjShell.AppActivate("spotify")
Spotify's name changes when the song is playing