alternative ways to showwindow?
Posted: 08 Feb 2018, 19:16
I'm using ControlClick to interact with Spotify (automatically), however the window ofc. needs to be visible for this to work, trying to get it to show it [the window when its behind another or minimized] without activating it is somewhat a struggle though;
I've tried changing Z-Order with DllCall("SetWindowPos", UInt, hwnd, UInt, 1, Int, 0, Int, 0, Int, 0, Int, 0, UInt, (SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW)), but it does nothing.
using showwindow DllCall("ShowWindow", UInt, hwnd, Int, SW_SHOWNOACTIVATE), but it does nothing.
SetForegroundWindow/SwitchToThisWindow works but ofcourse it activates the window, BringWindowToTop does nothing.
All return success [with no A_LastError] and running the script as admin doesn't change the results.
The only other working method is setting AlwaysOnTop but this isn't ideal.
Any other methods I've missed, before resorting to AlwaysOnTop?
*EDIT*
Just for confirmation heres what the I get back from each call:
I've tried changing Z-Order with DllCall("SetWindowPos", UInt, hwnd, UInt, 1, Int, 0, Int, 0, Int, 0, Int, 0, UInt, (SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW)), but it does nothing.
using showwindow DllCall("ShowWindow", UInt, hwnd, Int, SW_SHOWNOACTIVATE), but it does nothing.
SetForegroundWindow/SwitchToThisWindow works but ofcourse it activates the window, BringWindowToTop does nothing.
All return success [with no A_LastError] and running the script as admin doesn't change the results.
The only other working method is setting AlwaysOnTop but this isn't ideal.
Any other methods I've missed, before resorting to AlwaysOnTop?
*EDIT*
Just for confirmation heres what the I get back from each call:
Code: Select all
A_IsAdmin: 0
WindowHwnd: 0x1e60586
BringWindowToTop: 1
ErrorLevel: 0
A_LastError: 0
ShowWindow: 24
ErrorLevel: 0
A_LastError: 0
SetForegroundWindow: 1
ErrorLevel: 0
A_LastError: 0
BringWindowToTop: 1
ErrorLevel: 0
A_LastError: 0
--------------
A_IsAdmin: 1
WindowHwnd: 0x1e60586
BringWindowToTop: 1
ErrorLevel: 0
A_LastError: 0
ShowWindow: 24
ErrorLevel: 0
A_LastError: 0
SetForegroundWindow: 1
ErrorLevel: 0
A_LastError: 0
BringWindowToTop: 1
ErrorLevel: 0
A_LastError: 0