Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Alt-F4 in Windows 8



  • Please log in to reply
15 replies to this topic
stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

I have been using this script for years and it has always worked to close the window under the mouse.

 

Now I have Windows 8 it works in about half the windows only. I am not talking about the Windows 8 apps, although it seems to work fine there, but in things like CCleaner or Event Viewer. These all worked fine in Windows 7 but not 8.

 

Can anyone through any light on what might be wrong

F11::
{
{
SetMouseDelay, 10
MouseGetPos,,, hovwin,hovcontrol
IfWinExist, ahk_id %hovwin% ahk_class Shell_TrayWnd
Send {Click}{AltDown}{F4}{AltUp}
}
{
SetMouseDelay, -1
WinGetClass, hovClass, ahk_id %hovwin%
IfWinNotActive, ahk_id %hovwin%
if hovClass <> #32769
{
WinActivate ahk_id %hovwin%
ControlFocus %hovcontrol%, ahk_id %hovwin%
}
Send, {AltDown}{F4}{AltUp}
}
return
}

TIA

 

 

Solution:

 

If I run Logitech's Setpoint.exe AND the compiled ahk script as an Administrator - problem solved. I can't tell you how much this has bugged me and how pleased I am to have it fixed.

 

Thanks to all who contributed.


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
i thought you said you just want to close the window under the mouse?

what is all that other stuff in the script doing?

ErrorOnLine1
  • Members
  • 230 posts
  • Last active: Oct 05 2015 02:46 PM
  • Joined: 25 Dec 2012

I'm not on Win8, but maybe something simple like this would work 99.999% of the time.

;SuperZapper

NumPadEnter:: ;Closes current web page, window, or program
NumPadAdd:: ;Closes current web page, window, or program
Sleep 500 ;the sleep command is your friend
Send, !{F4}
Sleep 200
WinGetClass, class, A
If class = ConsoleWindowClass
  {
   SendInput, !{Space}c
  }
Return

 

 



stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

Thanks for trying but still no luck.

 

I have tried a few variations of this script I have found here but it just will not work in Win8.

 

Even a very simple

NumPadAdd:: Send, !{F4}

does not work with Ccleaner or Event Viewer.

 

I don't know what is different about these windows compared with an Explorer or Outlook window.

 

I was hoping somebody might have the answer.

 

I live in hope!!


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
dont know what you're doing wrong

i'm using Win8 and this works on both Notepad and Event Viewer:
F9::Send, !{F4}


stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

Event Viewer or Task Manager or Services does not work with your script.

Notepad works and always has.

Alt-F4 on the keyboard works fine and always has.

 

I have just installed a fresh copy of Win8 into VMware and copied over you script (compiled) and run it. Used the On-screen Keyboard to give me F9. Same result.

 

I am using Setpoint on my main machine and I have one of the function keys set for Alt-F4 and even that will not work. I tried the key in the Virtual machine and it worked with Event Viewer, Task Manager and Services.

 

It is very strange


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

Would this work?

 

!F4::WinClose A

My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!


stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

It's a nice idea but alas no luck!

 

I can't be alone with this issue. I have tried 3 Win8 machines with the same result.

 

Is there anyone else having this problem?  I would appreciate some feedback.

 

Thanks


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

Event Viewer or Task Manager or Services does not work with your script.

all three work for me, compiled or not
F9::Send, !{F4}
i hope you are running the script INSIDE the VM on the win8 guest. you cannot expect hotkeys to pass thru from your host machine to the guest

stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

Yes, the script was running inside the Win8 guest and then used the on-screen keyboard, also within the guest, to give F9 - no luck.

 

I have a function key that gives Alt-F4 on the host that will not close Task Manager etc on the host but does close Task Manager etc on the Win8 guest when it has focus.

 

I am wondering if Setpoint is the issue. Do you use it?


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
i dont use it, i use a few things as possible

and F9 works on notepad?

stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

Notepad is fine


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
so the script is obviously working then, theres gotta be something stopping it

stu222
  • Members
  • 14 posts
  • Last active: Sep 15 2015 08:57 PM
  • Joined: 02 Jan 2009

Yes your script and my script work. I have been using mine for the last 5 years. It works in XP, Vista, Server and Win7 perfectly. In fact I have all operating systems on my machine. It's only Win8 that doesn't work. I have a separate Media Center PC with Win8 Win7 and XP and it's only Win8 with the same issue. Setpoint is on both machines. However it's not on the Win8 guest.


Gigabyte GA-MA770-UD3, QuadCore AMD Phenom II 940, OCZ Gold XTC 2 x 2 GB DDR2-800 DDR2 SDRAM, NVIDIA GeForce 8600 GT, WD 500GB (Raid Edition II) x 3 Raid0, Optiarc DVD RW AD-7201S SATA, Hauppauge Nova-T-PCI DVB-T Tuner, Windows7 x64 Ultimate SP1

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
well my guess is that win8 is not the problem

it works for me, and i have no reason to believe it wouldnt work for you. maybe you have something installed preventing you