This is probably an easy question, but I haven’t been able to figure this out in the documentation: where does WinHide hide windows? And more importantly – how to retrieve a window "manually", if I hide it through WinHide, and then accidentally close the script, losing the handle to the window?
I’ve written a workaround which generally shows the window before closing a script, but it would be nice to know this anyway
Where does WinHide hide windows? Topic is solved
-
- Posts: 23
- Joined: 28 Mar 2019, 05:27
-
- Posts: 1472
- Joined: 05 May 2018, 12:23
Re: Where does WinHide hide windows?
You could just do a winshow with the exe
-
- Posts: 23
- Joined: 28 Mar 2019, 05:27
Re: Where does WinHide hide windows?
I know how to show it with a script, I was wondering how to do it without one, when I close AHK. My original script allows me to choose a window and hide it when I need to. Let’s say I hid it, then closed the script, and I’m not even sure what window I hid before. Is there any way to see a list of hidden windows in Windows 10? Alternatively, if there is a command like WinShow which shows all hidden windows that there are, it could also work (although I would prefer the first solution).
Re: Where does WinHide hide windows? Topic is solved
I am not aware of a "standard" Windows program that would do this (in task manager you can still see and terminate the processes of hidden windows, though - but there will be a lot more of them that you didn't hide yourself).
That said, you are using a rather low-level method - the Windows API - to hide the windows (for this you need a programming or scripting language like AHK or a third-party program) - and then you also need the Windows API to enumerate these hidden windows and make them visible again (again you will need another tool or AHK or some other language that can call the windows API to do this.) But the Windows API will not keep track which windows excactly your script hid, afaik (so most hidden windows will have nothing to do with your script and unhiding them all won't make you happy )
But you could just keep track in your script of all windows you hid (or write them to a text file, if you like) and unhide them, when you exit the script... OnExit could help. (But you seem to be already doing something like this...)
That said, you are using a rather low-level method - the Windows API - to hide the windows (for this you need a programming or scripting language like AHK or a third-party program) - and then you also need the Windows API to enumerate these hidden windows and make them visible again (again you will need another tool or AHK or some other language that can call the windows API to do this.) But the Windows API will not keep track which windows excactly your script hid, afaik (so most hidden windows will have nothing to do with your script and unhiding them all won't make you happy )
But you could just keep track in your script of all windows you hid (or write them to a text file, if you like) and unhide them, when you exit the script... OnExit could help. (But you seem to be already doing something like this...)
-
- Posts: 23
- Joined: 28 Mar 2019, 05:27
Re: Where does WinHide hide windows?
I am indeed unhiding the windows upon exiting (with a loophole, but I will fix it), but I thought there had to be some obvious solution. If not, I’ll just accomodate. Thanks!
Re: Where does WinHide hide windows?
Hallo,
one problem is the large number of hidden windows.
Try:
one problem is the large number of hidden windows.
Try:
Code: Select all
Hidden = 0
DetectHiddenWindows, On
WinGet, All, List
DetectHiddenWindows, Off
WinGet, NotHidden, List
Loop, %All%
{
ID := All%A_Index%
Loop, %NotHidden%
If (ID = NotHidden%A_Index%)
ID =
IF !ID
Continue
Hidden++
Hidden%Hidden% := ID
}
MsgBox,% "Number of windows:`nAll: " All "`nHidden: " Hidden "`nNotHidden: " NotHidden