Need to disable ALT+F4's closing application functionality
Need to disable ALT+F4's closing application functionality
Hi all,
I'd like to disable ALT+F4's ability to close World of Warcraft but I still want ALT+F4 to be usable as a keybind in-game.
I've been looking through a lot of posts and I don't think I've come across a solution to my issue. That being said I don't have a script to start off with since I've tried many iterations of disabling !F4 with no success. Any help would be appreciated!
I'd like to disable ALT+F4's ability to close World of Warcraft but I still want ALT+F4 to be usable as a keybind in-game.
I've been looking through a lot of posts and I don't think I've come across a solution to my issue. That being said I don't have a script to start off with since I've tried many iterations of disabling !F4 with no success. Any help would be appreciated!
Re: Need to disable ALT+F4's closing application functionality
Welcome to this AutoHotkey forum!
Code: Select all
!F4::MsgBox, 48, Nope, Nope!
Re: Need to disable ALT+F4's closing application functionality
That sounds like a permissions issue.
https://www.autohotkey.com/docs/FAQ.htm#uac wrote:By default, User Account Control (UAC) protects "elevated" programs (that is, programs which are running as admin) from being automated by non-elevated programs, since that would allow them to bypass security restrictions. Hotkeys are also blocked, so for instance, a non-elevated program cannot spy on input intended for an elevated program.
Re: Need to disable ALT+F4's closing application functionality
I've tried running AHK as admin as well as running the script as admin but with no luck. Is there more that I could do to elevate permissions? Maybe to temporarily alter registry to disable the application-closing functionality of ALT+F4?gregster wrote: ↑15 Sep 2022, 21:50That sounds like a permissions issue.
https://www.autohotkey.com/docs/FAQ.htm#uac wrote:By default, User Account Control (UAC) protects "elevated" programs (that is, programs which are running as admin) from being automated by non-elevated programs, since that would allow them to bypass security restrictions. Hotkeys are also blocked, so for instance, a non-elevated program cannot spy on input intended for an elevated program.
I'm trying this simple script from a previous thread but it's disabling the key bind all together. ie I can press F4 to use an ability, I can press ALT+F1 to use an ability, but ALT+F4 isn't registering as a key press at all.
Re: Need to disable ALT+F4's closing application functionality
Simple script that I forgot to add
!F4::Return
!F4::Return
Re: Need to disable ALT+F4's closing application functionality
Is there a way to turn !F4::Return into disabling the close-program function without disabling the full keybind?
Re: Need to disable ALT+F4's closing application functionality
1. What is the close-program function?
2. What does "without disabling the full keybind" mean?
2. What does "without disabling the full keybind" mean?
Re: Need to disable ALT+F4's closing application functionality
@mikeyww 1. Close-program function: When press Alt+F4 it closes the active program/window.
2. I'm using the keybinds Alt+F1-12 in a game, World of Warcraft specifically. I don't want Alt+F4 to close my game but I still want to use Alt+F4 as a keybind in game. Is it possible?
2. I'm using the keybinds Alt+F1-12 in a game, World of Warcraft specifically. I don't want Alt+F4 to close my game but I still want to use Alt+F4 as a keybind in game. Is it possible?
Re: Need to disable ALT+F4's closing application functionality
Yes. You can create a hotkey for Alt+F4. An example is in my first post.
Re: Need to disable ALT+F4's closing application functionality
I understand that I can create a hotkey for Alt+F4. My question is, is it possible to stop Alt+F4 from closing the active program/window WITHOUT disabling the keystroke all together? If so, what would that script look like?
Re: Need to disable ALT+F4's closing application functionality
I do not understand the question. What should happen when the key combination is pressed? You would use the answer for your new hotkey.
Re: Need to disable ALT+F4's closing application functionality
When I press Alt+F4, I want the key combination to be executed as normal(as if I'm pressing any other key combination like Shift+F2) but I don't want it to close the game.
Re: Need to disable ALT+F4's closing application functionality
Simply put, when the script is active I don't want Alt+F4 to close applications.
Re: Need to disable ALT+F4's closing application functionality
I am puzzled. Your game would probably have a maximum of one way to handle Alt+F4, even if it uses that way to do different things in different contexts. With AHK, you have the choice of letting your game do what it usually does, or doing something different via AHK. If pressing the keys usually closes your game, then that would be the normal action, and you could use AHK to alter it as you like.
Re: Need to disable ALT+F4's closing application functionality
Could a script toggle the application-closing function within windows, via registry edits? If so, could someone write it for me?
Re: Need to disable ALT+F4's closing application functionality
You can just use a hotkey to do that. We are going around in circles.
Re: Need to disable ALT+F4's closing application functionality
Ok, what would that hotkey code look like? I'm hoping someone could write it for me
Re: Need to disable ALT+F4's closing application functionality
Hmm... I can see that I'm not being helpful, so will sign off here. Others may have some suggestions for you. Best of luck.
Re: Need to disable ALT+F4's closing application functionality
Hi, try thistiltedtim wrote: ↑15 Sep 2022, 09:00Hi all,
I'd like to disable ALT+F4's ability to close World of Warcraft but I still want ALT+F4 to be usable as a keybind in-game.
I've been looking through a lot of posts and I don't think I've come across a solution to my issue. That being said I don't have a script to start off with since I've tried many iterations of disabling !F4 with no success. Any help would be appreciated!
Code: Select all
Alt_Pressed := false
*LAlt::
Alt_Pressed := true
KeyWait, LAlt
Alt_Pressed := false
return
#if Alt_Pressed
$F4::return
#if
Re: Need to disable ALT+F4's closing application functionality
I had faith in that one but no luck. It acts the same as !F4::return. Unfortunately, I don't think AutoHotkey is the solution to this problem, and I need to look into disabling the force-quit function within windows registry.