0

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

Flompy Doo
  • 21
  • 9
  • Possible duplicate of [Using Java to set the focus to a non Java application in Windows](https://stackoverflow.com/questions/4782231/using-java-to-set-the-focus-to-a-non-java-application-in-windows) – azurefrog Sep 12 '17 at 19:48
  • @azurefrog The VBs code doesn't work: – Flompy Doo Sep 12 '17 at 22:53

0 Answers0