title: Why is my call to WinGetTitle returning an empty string?
body: <p>I'm building a script that will pause my music if it's playing when I lock my workstation. I use spotify, which should be simple to get it's play state by inspecting the window title. When not playing anything, it's title is simply "Spotify", but when it's playing media, the window title changes to the title of the track currently playing. I can see this using the Window Spy.</p>
  
  <p>I've tried finding the spotify window and reading it's title, using <code>WinGetTitle, title, ahk_exe Spotify.exe</code> which should write the title into the var <code>title</code>. This doesn't work, <code>title</code> is an empty string. Intriguingly however it works if the spotify window is minimized.</p>
  
  <pre><code>#L::
  {
     WinGetTitle, title, ahk_exe Spotify.exe
     if(title != "Spotify")
     {
        Send {Media_Play_Pause}
     }
     DllCall("LockWorkStation")
     return
  }
  </code></pre>
  
  <p>This is on Windows 10. <code>WinGetClass, c, ahk_exe Spotify.exe</code> correctly finds the window, but the class name is <code>Chrome_WidgetWin0</code> because I'm guessing the app is written in Electron. Other electron apps seem to have the same class name, just incrementing the number at the end.</p>
  
  <p>What I'd love is a way of hooking into whatever windows API spotify is using to report it's current play state, as Windows 10 recognises it as a media application and adds play/pause buttons to it's tab in the taskbar, and in the windows volume control overlay.</p>
  
  <p>Thanks</p>