How to disable alt+tab in windows 10 without autohotkey

23,270

Solution 1

It's too early to give a negative answer within the context of not using any third-party product, but here are the results of my historical research, which might help in advancing on this question.

The decision to make Alt-Tab extremely hard to intercept was taken in Windows NT. The article describing what was done has disappeared from the Internet, but I have found an old edition on the Wayback Machine, dating from December 2003. Because it's so hard to find, I reproduce it here as an image:

image

The three solutions listed by the Microsoft developers (dating from the time when they still answered user queries) are :

  • Modifying the Windows kernel, meaning Windows DLLs (I have no intention).
  • Register for hotkeys via API function RegisterHotKey, which can only be done by injecting a DLL into the game while executing, so can get you seriously banned for life.
  • Create a system-wide keyboard hook, like AutoHotKey does, which you say can also get you banned.

If we can believe the original developers of NT, these are the only options, of which the only realistic solution involves a program such as AutoHotKey.

From my side I can see no other solution, but perhaps someone else knows about some other clever hack.

An AutoHotKey script to disable Alt-Tab is :

#IfWinActive Counter-Strike: Global Offensive
LAlt & Tab::
return

You should put the right title on the #IfWinActive command, for Alt-Tab to only be disabled while the game has the focus.

For games that use a low-level access to the keyboard, the script might need to be Run as Administrator.

Solution 2

Because it looks like it's almost impossible to solve the Problem without a 3rd party software, I would camouflage AutoHotkey this way:

  1. Copy AutoHotkey.exe, rename it and move it to a less suspicious directory, e.g. copy c:\Program Files\AutoHotkey\AutoHotkey.exe
    to c:\Program Files\Microsoft\Monitor.exe or even to System32.
  2. Rename the AutoHotkey-Script extension .ahk to e.g. .cfg,
    for example save it here: c:\Users\<user>\Monitor.cfg
  3. Start the script, e.g.: c:\Program Files\Microsoft\Monitor.exe c:\Users\<user>\Monitor.cfg

I guess it will not be detected.

If it is recognized anyway, I would also change the properties of the copied exe file by using e.g. stackoverflow: How to change an executable's properties? (Windows) so that no file Property reminds of the origin, for example the File Description reads as e.g. "Application Monitor"

Share:
23,270
Ieva
Author by

Ieva

I am a Computer Engineer. Things listed below are just a few things i am knowledgeable of: C/C++/C#, java, QT, Android, linux, Object Oriented, Assembly, computer architecture, MIPS, msp430, networking, html, php, css, mysql, sqlite, oracle

Updated on September 18, 2022

Comments

  • Ieva
    Ieva over 1 year

    How can a person disable Alt + Tab in Windows 10 without using any third party software like AutoHotkey?

    Accidentally hitting Alt + Tab while gaming is really annoying. And some games do not allow the use of AutoHotkey or other third party software.

    I need Alt + Tab disabled, but still want to have the ability to use the Alt and Tab keys individually.

    • Biswapriyo
      Biswapriyo over 5 years
    • Ieva
      Ieva over 5 years
      I only see cool switch column and row.
    • Ieva
      Ieva over 5 years
      @Biswapriyo I dont believe that is relevant anymore.
    • gbvisconti
      gbvisconti over 5 years
      How do you accidentally hit alt+tab? (just curious)
    • Ieva
      Ieva over 5 years
      @gbvisconti Well... it is not accidental. But i have things bound to alt and things bound to tab. When performing those two actions at the same time, it activates windows alt+tab.
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 5 years
      Prolink - I read over some of docs.microsoft.com/en-us/windows-hardware/customize/enterpri‌​se/… and docs.microsoft.com/en-us/windows-hardware/customize/enterpri‌​se/… and I determined that Alt-Tab may be hex A5 or int value of 165 but I cannot get the PS logic to find the namespace but I was going to test but wanted to post in case someone else knows how to make that work potentially for an answer. . . Maybe it'd be Remove-Scancode "Alt-Tab" 165
    • Alex P.
      Alex P. over 5 years
      just use the Scancode Map to swap tab with some other hard to reach key and rebind your actions to that key instead of tab
    • SilvaR
      SilvaR over 5 years
      Lift your alt key from your keyboard with a knife while you are playing. Reinsert it when you're done.
    • Ieva
      Ieva over 5 years
      @RicardoS. I need to be able to use alt still. I basically just need to disable the alt+tab combination, not remove a key.
    • SilvaR
      SilvaR over 5 years
      @prolink007 Yeah,I'm sorry that was a bit tongue in cheek of me.
  • Albin
    Albin over 5 years
    This is sort of outdated. Of course it's true for Windows NT, but in later versions of Windows the option to disable Alt+Tab was reintroduced via a registry setting, which unfortunately does not work any more in Windows 10.
  • Albin
    Albin over 5 years
    And out of curiosity (I'm not a gamer, well at least not any more) why would a "system-wide keyboard hook" will get you banded from a game? Could you please post the link to the entry of the wayback machine as well? Thanks!
  • Albin
    Albin over 5 years
    But back on topic, maybe I found a solution here. This has been adopted to be used with the alt-key as well, I wonder if it will work for Alt+Tab as well. Feel free to give it a try.
  • Albin
    Albin over 5 years
    Offtopic comments moved to chat
  • harrymc
    harrymc over 5 years
    @Albin: Nothing was moved, so rests to be done manually.
  • Albin
    Albin over 5 years
    The rest of the comments are ontopic and point out (possible) additions&flaws in you're answer. They shouldn't be moved. We really shouldn't do any further discussion here, we should use the chat for that. Feel free to delete this comment once you read it.
  • harrymc
    harrymc over 5 years
    AutoHotkey is detected by its system hook, not its name.
  • harrymc
    harrymc over 5 years
    @Albin: Will you have me again prove that NT is not totally outdated, that in fact Windows 10 is "part of the NT family"? And to say again why your link doesn't solve the problem? Come on, let's clean it up.
  • Ieva
    Ieva over 5 years
    @albin what is the value I would use for alt tab? They are slowing the value for Windows key.
  • Albin
    Albin over 5 years
    @prolink007 I haven't had time to find out and try, that's why I didn't post an answer yet (I don't like writing answers that just name solutions but don't show you how to do it). Meanwhile if you want to try it you're self, it shouldn't be to hard to find the value on the net. I hope I will find some time before the bounty deadline runs out.
  • harrymc
    harrymc over 5 years
    If you are asking about the link provided by @Albin, this is not part of my answer and in any case does not help you, since it doesn't work for key combinations. You may with it disable totally the Alt key or the Tab key for all programs, but not the combination when both are pressed at the same time, which is absolutely not what you want. If you are asking for the AutoHotKey script to disable Alt-Tab, I included it in my answer.
  • harrymc
    harrymc over 5 years
    @Albin: This is for the scan-code mapper. But go ahead, do it if you think you can. I said what I had to say and I'm not going to argue any more.
  • Albin
    Albin over 5 years
    @prolink007 The stackoverflow post is (supposed to be) for the "ALT & Application key" not one individual key (but I haven't verified yet if it works just for the combination or each key indevidually)
  • harrymc
    harrymc over 5 years
    @Albin: I know the scan-code mapper, and you can with it exchange keys or disable them. Read about Alt in Keyboard Input : "if the ALT key is held down, pressing the A key produces ALT+A, which the system does not treat as a character at all, but rather as a system command". Alt combinations have no scan-code, so cannot be mapped, only the system command can be trapped, but not mapped through the scan-code mapper.
  • Albin
    Albin over 5 years
    @harrymc as I said, I'll be happy to discuss any issue with you, but please use the chat for that, no need to bother other users with our discussion in the comment section. thanks.
  • Tom
    Tom over 5 years
    Good to know... but: Do you guess it or are you sure that they are checking the system hooks? I ask because Windows itself and many other Software use system hooks, too. Therefore it's really hard to decide if it's a 'bad' or 'good' system hook...
  • harrymc
    harrymc over 5 years
    It all depends on the game developers, on what kind of interference they allow.
  • harrymc
    harrymc over 5 years
    @prolink007: No other answer has come up. I think you should now decide.
  • Ieva
    Ieva over 5 years
    Lol. True but none are the solution. I don't accept answers unless they solve the problem.
  • harrymc
    harrymc over 5 years
    If I set you as problem to prevent the sun coming up in the morning, would you also only accept an answer that solves the problem? You got your only possible answer, which is to use AutoHotKey, which does solve the problem. It's your decision to avoid it because you will not take the chance of being banned. I myself don't believe that this will happen, because many products set such a system hook, but it's still your choice and not mine.
  • Max Young
    Max Young almost 4 years
    +1 for image of a the article.