Page 1 of 1

winactivate with DetectHiddenWindows(true)

Posted: 29 Apr 2024, 01:29
by erann
In v1, in order to find and activate a window on a different virtual desktop, I switched on DetectHiddenWindows. Is there a way to do the same with V2?

The following script does not activate a window. Only when DetectHiddenWindows is set to 0 or line commented out the window is properly activated.

Code: Select all

#Requires AutoHotkey v2+
DetectHiddenWindows(true)
WinActivate SomeWindowTitle

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

Re: winactivate with DetectHiddenWindows(true)

Posted: 29 Apr 2024, 06:02
by mikeyww
If that works, use it. The windowing functions act upon the topmost matching window (unless noted otherwise). A hidden window might be found in your case. Being more specific with your WinTitle might also prove successful.

Re: winactivate with DetectHiddenWindows(true)

Posted: 29 Apr 2024, 06:58
by erann
Specifying the hwnd of the window indeed solved the issue. Thanks!