![]() Focus the document window without bringing the app to the foreground. SpotifyHwnd := DllCall("GetWindow", "uint", spotifyHwnd, "uint", 2) The script must be copied to a text file and the extension must be changed from. hotkeyP must be installed and configured to open the script by hotkey (I have 1 key, Pause/Break). SendKeyToSoftware(processExe, key, method) AltR + Delete Toastyfy must be installed and set to Alt + Shift + S hotkeys to show Spotify. SoftwareHwnd := DllCall("GetWindow", "uint", softwareHwnd, "uint", 2) We need the app's third top level window, so get next twice. WinGet, softwareHwnd, ID, ahk_exe %processExe% SendKeyToSoftware.ahk : Get the HWND of the software's main window. I renamed the function "sendKeyToSoftware()". I'm actually rewritting if to separate the hotkeys mapping form the logic, and also to make the code more "universal". ![]() Moving DetectHiddenWindows, On inside functions doesn't fix it.Įdit2 : PostMessage, 0x319, 0圎0000, ahk_id %softwareHwnd% is the correct method to send the command at line 24 of your script. By closing Twitch, I fixed the problem and now your script is working.Įdit : but it doesn't work when the windows is minimized. WinGet, style, Style, ahk_id %spotifyHwnd%Īfter 2 hours of tests, I found that if an other Chrome Window with Twitch is opened (actually, it's the "Twich desktop app"), the command is send to this window instead of the Spotify one. Focus the document window without bringing the app to the foreground.ĬontrolFocus, Chrome_RenderWidgetHostHWND1, ahk_id %spotifyHwnd%ĬontrolSend,, %key%, ahk_id %spotifyHwnd% Chromium ignores keys when it isn't focused. WinGet, spotifyHwnd, ID, ahk_exe spotify.exe ![]() Get the HWND of the Spotify main window. License: GNU General Public License version 2.0 AutoHotkey script to control Spotify with global keyboard shortcuts
0 Comments
Leave a Reply. |