Author Topic: [v1.5.10.6] Hidden windows cannot be unhidden  (Read 4337 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
[v1.5.10.6] Hidden windows cannot be unhidden
« on: July 24, 2016, 12:18:29 PM »
Given the following actions:
Code: [Select]
Run application 'notepad.exe'
Pause 3 seconds
Display window 'notepad.exe' as [Hide]
Pause 3 seconds
Display window 'notepad.exe' as [Show]

Notepad starts, notepad disappears after 3 seconds, notepad does not reappear after 3 seconds.

Starting the application as hidden and attempting to call "Show" on it will have the same result.
« Last Edit: July 24, 2016, 08:08:00 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.5.10.6] Hidden windows cannot be unhidden
« Reply #1 on: July 24, 2016, 07:04:09 PM »
Although the process is available and has a handle, the main window's handle of a hidden app is made unavailable (value is zero).  I am guessing that is a good thing.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: [v1.5.10.6] Hidden windows cannot be unhidden
« Reply #2 on: July 24, 2016, 08:07:36 PM »
Apparently the handle remains available, even though you can't query for it.

Either way, my intent was to start an application hidden and use "Show no activate" to prevent it stealing focus, which apparently isn't possible as starting hidden doesn't create a window in the first place.

Starting an application without stealing focus in general appears to be nearly impossible as well, so I guess that's that.


Most used desktop OS, actually called "Windows", ironically can't do proper window management. Go figure.


EDIT: So I figured I could at least switch back quickly after launch, but then
Code: [Select]
Run application 'notepad.exe'
Pause 3 seconds
Write '[Purple] {WINDOWEXISTS:*notepad*}' to log
Start Loop While : [{WINDOWEXISTS:*notepad*}] Equals '0'
End Loop
Write '[Purple] Switch' to log
Doesn't ever detect the window existing.

I know I can use "Wait until launched application is started before continuing", I'm mentioning the bug for the sake of the bug at this point.
« Last Edit: July 24, 2016, 08:35:41 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.5.10.6] Hidden windows cannot be unhidden
« Reply #3 on: July 24, 2016, 08:30:08 PM »
I guess we can say, 'hidden' is not just hidden from view, but also hidden to external access.  Not sure I would call that bad.  What is bad is that an app's window can be set to hidden from another application (not sure of the security context rules) and can't be recovered externally.