Author Topic: Close Active Window  (Read 3652 times)

Gerrik

  • Guest
Close Active Window
« on: December 08, 2017, 07:55:31 AM »
Hi,

i want to close a focused program or folder.

I made a new command with:
When I say -> close,
Other -> Perform a Window Function,
Window Title -> [Active Window],
and set the radiobutton Close Window.

When i use this command, i get the log entry:
Unable to acquire window or process for window function

OS: Win10 Pro x64
VoiceAttack: v1.6.9 Demo

I have no idea, what i'm doing wrong.

Help please.  :'(

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Close Active Window
« Reply #1 on: December 08, 2017, 09:41:12 AM »
Looks like a bug. Replace "[Active Window]" with "{ACTIVEWINDOWTITLE}" and it should work(you may need to select an existing window first to enable text input to that dropdown).

Gerrik

  • Guest
Re: Close Active Window
« Reply #2 on: December 08, 2017, 10:17:31 AM »
Thanks Pfeil.

Programs are closing now.
When i try it with a folder, then windows shows me the dialog where i can choose to shut down, restart the system.
Maybe it tries to close the explorer when a folder has the focus.

I'm testing and try to learn the program before i buy it,
so this workaround helps alot. :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Close Active Window
« Reply #3 on: December 08, 2017, 12:00:06 PM »
When i try it with a folder, then windows shows me the dialog where i can choose to shut down, restart the system.
Maybe it tries to close the explorer when a folder has the focus.
Odd, explorer windows close fine on my machine, though I am running Windows 7.

Running the command when the desktop has focus(where pressing Alt-F4 would usually bring up the dialog you mention) just throws the "Unable to acquire window or process for window function" error, which is fair enough as it's not a window.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Close Active Window
« Reply #4 on: December 08, 2017, 12:40:42 PM »
On my Win 10 Pro 64, using {ACTIVEWINDOWTITLE} on an explorer folder closes the folder.  Open desktop shows the dialog to restart/shutdown/etc.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Close Active Window
« Reply #5 on: December 08, 2017, 11:15:09 PM »
I changed some things and that affected the way that this feature was working.  I have fixed the issue and it will be in the next beta.  Sorry about that :(

I just remembered why your Windows is wanting to shut down and mine is not.  You'll want to run your explorer, 'folder' windows in their own process in order to do what you are wanting:

https://winaero.com/blog/how-to-start-file-explorer-in-a-separate-process-in-windows-10/

Not sure why this is not on by default in Windows, but I always turn it on after an install.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Close Active Window
« Reply #6 on: December 09, 2017, 11:53:16 AM »
I just remembered why your Windows is wanting to shut down and mine is not.  You'll want to run your explorer, 'folder' windows in their own process in order to do what you are wanting

Ah, now that you mention it, I do have that enabled as well.

I've tweaked so many things in my Windows install it's easy to forget how illogical some of the default settings are ::)