83

I've got a couple of shortcuts on my desktop and on some of them I've configured the "Shortcut key" to a keyboard combination. For example I have a shortcut pointing to d:\documents\todo.txt and I've set Shift + Alt + T. This naturally opens up using notepad.

Double-clicking on the icon always opens up the text file immediately. Using the keyboard shortcut though is sometimes very (5-10 seconds) slow. Note that during that time CPU utilization does not rise.

This happens to all my machines (both old and new ultra fast boxes) in Windows XP (various versions) and Windows 7.

There are tons of questions about this but no solution.

Is there an explanation and solution to this problem?

Edit: The behavior is not consistent. I have 30 desktop shortcut and 5 of them have keyboard shortcuts assigned. I'm not interested in software alternatives for this Windows functionality. I want to know what the problem is and how to solve it.

Edit 2023: I have upgraded to Windows 10 and it is still happening.

9
  • 1
    Does this happen when booting in Safe mode? If not, then try turning off your antivirus or other security products. If this helps, tell us which product caused this.
    – harrymc
    Jul 30, 2013 at 15:14
  • @Psycogeek: Good observation but D: or a sleeping drive doesn't have anything to do with this.
    – cherouvim
    Aug 4, 2013 at 5:10
  • If I was observing a little closer :-( , I would have noticed that your shortcuts are working fine. It is only the Keyboard shortcuts that have the delay. None of your "windows" own Key commands are slow right?
    – Psycogeek
    Aug 4, 2013 at 5:32
  • 1
    I killed "SetPoint.exe", Logitech's mouse parameters software, and it resolved my problem
    – Goldorak84
    Sep 23, 2013 at 15:56
  • 8
    I'm late to the party, but I recently encountered the same issue. I coded a quick-and-dirty utility to locate processes that aren't responding to the hotkey request message. I would post the code here as an answer but I can't because the question is protected and I don't have the required rep (although my profile claims that I have 101 and it only requires 10). I wrote a blog post about it where you can get the code. My apologies for the pseudo-spam. I'll post the code here as an answer when I have the required rep.
    – Bob Mc
    Jan 1, 2016 at 2:32

14 Answers 14

88

The original question deals with Windows 7, but it's happening now for new reasons in Windows 10. Here's a general answer that deals with both situations.

The general problem

There's an excellent explanation of the problem and its cause at the 2012 MSDN post Why is there sometimes a long delay between pressing a hotkey for a shortcut and opening the shortcut?

Executive summary: before launching a program via its shortcut key, Windows first polls all currently running programs and asks "Is this your shortcut key?" If so it switches focus to that window rather than spinning up a new copy of the program.

The problem happens when a window somewhere refuses to answer the question. This can be a program that's generally non-responsive for some reason, though it can also happen for other reasons (see below). Windows waits 3 seconds before muttering "jerk" under its breath and moving on to the next window to ask it the same shortcut question.

Finding unresponsive programs

  1. Start Windows, then before opening any other programs try a shortcut key. Do you experience a delay? If so, go to step 3.
  2. Launch any other programs you typically run. Do you experience a delay? If not, wait until you do.
  3. One by one, stop each interactive program; cycle through them with Alt-Tab to be sure you've got them all. After stopping each one, see whether the shortcut delay has gone away.
  4. Still have a delay? Do the same thing with the icons in the taskbar's notification area (aka the "system tray"): right click and exit, checking for the shortcut delay after each one. You might need to expand the notification area to see all of those icons.

Now that you know your culprit, you get to decide: is that program worth the delay it causes? For example, Adobe Creative Cloud has sometimes caused problems for me, so I just tell it not to run when Windows starts. I can still use Illustrator etc. without it running.

If you can't live without the program, either live with the shortcut key delay or, as "user 99572 is fine" suggests, try a macro program like AutoHotKey.

Windows 10: Action Center

Windows Action Center can also cause the delay. (This might be a problem in Windows 8 too; I skipped from 7 to 10). Whenever you see this:

enter image description here

it means the Action Center has system notifications for you to review—which also causes the shortcut key delay, even though the Action Center isn't non-responsive per se.

Click the icon and clear the notifications, then the icon will look like this, and Action Center should no longer cause a shortcut key delay:

enter image description here

If a notification comes up repeatedly and you find it unhelpful, right click it and tell Windows to turn off notifications for that application.

BUT... sometimes Action Center can cause problems even if no notifications are waiting. Even with no notifications showing, I've often cleared up this problem simply by opening and closing Action Center. You can do this quickly with the [Windows]-A shortcut key combination.

Windows 10: unresponsive background processes

Sometimes a background process can cause this problem too. Two in particular are:

  • Calculator
  • Store

There might be others culprits as well. The significant thing is that these are foreground applications that, for some reason, appear as background processes even though you might not have actually run them. This problem might happen with other apps, and might be limited to Metro apps (TBD).

You can use some or all of the following techniques to eliminate these processes:

  1. Kill them manually with the task manager whenever you notice them.
  2. As discussed in harrymc's answer to this related superuser question, turn off specific background apps at Settings > Privacy > Background Apps. Not all apps can be turned off in this way.
  3. As discussed in Helen's answer to the same superuser question as above, disable Superfetch.

After using techniques #2 and #3, these rogue background processes no longer appear on my computer.

New problem in Windows 10 build 1809 (2/2019): Settings App

This Windows build has introduced a new and pernicious shortcut inhibitor. As soon as you start Windows, go to task manager. You have the problem if you see Settings running as a background task:

settings running as a background process

If you kill this task, shortcut keys will be fast again, but the Settings app will reappear a while later, re-introducing the problem.

As noted by Cerno in the comments, Windows 10 Enterprise users are able to prevent Settings from running in the background by going to Settings > Privacy > Background Apps. But for Windows Home and Professional users, "Settings" does not appear in the background app list. (If anyone knows of a way to make it appear, please post in the comments.)

July 2020 Update on Settings: After installing Windows 10 Pro v2004 Build 19041.388 (7/2020), my computer became unstable and I had to reinstall Windows. Since doing this, "Settings" now appears as an option in Settings > Privacy > Background Apps. I don't know whether this happened because of installing Build 19041.388 or because of the subsequent reinstall. In any case, disabling Settings as a background app has (finally!) resolved the problem for me.

Other...

This 3-second timeout probably doesn't cause every keyboard shortcut delay.

One one of my laptops, whenever Adobe Creative Commons is running in background I sometimes experience a delay lasting as long as 30 seconds before launching an app. That's 10 times the timeout Window uses before giving up on a non-responsive process, so something else must be going on in this case.

28
  • 3
    If anyone is a Win10 "insider" you can send this as a feedback via the feedback tool.
    – VoidStar
    Aug 24, 2015 at 0:53
  • 1
    Windows 10 is there and Calc issue is together :(
    – kokbira
    Aug 31, 2015 at 17:57
  • 19
    Just wanted to confirm that 'Turn off specific background apps at Settings->Privacy->Background Apps' did indeed speed up global hotkey speed. BTW I got there by typing in 'Settings' from the Start button. When I saw the list of Background Apps, I was a little shocked, I had no idea they were there, since I still use my computer like a PC, not a tablet. I turned off the entire list, and things became much more speedy. BTW I also have a SSD drive, turning off Search indexing offered no noticeable speed increase. Great suggestions.
    – sthede
    May 5, 2016 at 16:38
  • 3
    Currently on Windows 10, version 1709 & 'Turn off specific background apps at Settings->Privacy->Background Apps' did the trick; I turned off unnecessary apps & now desktop hotkeys always open up the exes immediately. Thanks for your suggestion. Nov 16, 2017 at 7:31
  • 3
    2019 here. Killing the Settings app did the trick for me. Mar 12, 2019 at 17:27
26

If you're on Windows 10, try killing "Application Frame Host" (ApplicationFrameHost.exe). This made the delay disappear on my system.

Note that if you kill this process, it will close any modern (UWP = Universal Windows Platform) apps you have running.

9
  • 3
    Welcome to Super User. Can you provide any more detail? What are some possible side-effects of killing this executable? Why is this program creating problems with shortcuts? Aug 24, 2015 at 2:45
  • 2
    This is the modern app host. If you kill it, you can't run modern apps. Most people don't care about this anyway. It causes a problem because it listens to all possible shortcut registrations for some reason, it didn't do that before Win10. Windows has always seemed to deal with multiple competing shortcut registrations badly... it leads to a delay. Every answer in this thread is related to such competing registrations in one way or another, but Windows 10 introduced ApplicationFrameHost.exe as a new culprit.
    – VoidStar
    Aug 24, 2015 at 4:26
  • 2
    Any ideas how to solve this? I have to kill that **** process several times per day and I'm not using any 'modern' apps.
    – icl7126
    Dec 15, 2015 at 12:15
  • 1
    @VoidStar it's the only solution worked for me, thank you. W10 is sometimes odd, I will report in through feedback programm, everybody, do the same and this bug will be fixed. Mar 17, 2016 at 21:47
  • 6
    @AlexZhukovskiy save this as .bat file: Taskkill /IM ApplicationFrameHost.exe /F. But I found another solution: disabling SuperFetch fixed all problems and now shortcuts works even when this process is running. (you can find SuperFetch in the list of services as SysMain)
    – icl7126
    Mar 17, 2016 at 21:56
12

My personal experience was that there was a program that was delaying Windows' handling of the hotkey. For myself it was Steam, for Andreas it was Akamai.

To diagnose which application is responsible simply close an application and try your hotkey again. Once you figure out who the culprit is, decide whether it's a service that you can deal with not running at all times.

I know this is a fairly old question, but after not finding an answer I stumbled upon the solution and felt the need to share it with the community.

3
  • For me it was setpoint.exe, logitech's mouse software
    – Goldorak84
    Mar 24, 2014 at 16:56
  • 7
    I have this problem in Windows 10 now. "Application Frame Host" is the culprit. Aug 14, 2015 at 13:00
  • 1
    FWIW, Adobe Creative Cloud has caused this problem for me, sometimes introducing as much as a 30-second delay to every app launch. However, I'm now experiencing the problem under a fresh Windows 10 install with Adobe CC disabled. Investigating that problem independently... Aug 14, 2015 at 14:58
7

The problem might have some to do with how Windows finds these shortcuts. Any reasonable person might expect that they store the shortcut data in the registry, the registry resides in RAM, and they put everything else in there. :-)

Instead the key shortcuts for .LNK and .URL are inside the shortcut itself.

As you can see in the picture, after trying to trace down where it was in the registry (it's not), I found the change in the shortcut own data itself.

There are 2 major locations where this data is scanned from, anywhere in all of the Start menu, and via the desktop folder.

When people find that removing some program, or some web program, "fixes" the problem, maybe it has to do with items, or mappings, or some unapproved stuff in the Start menu or the desktop?

After realising the method used, it was easy enough to take the advice of using another method other than windows, to do the same things.


The Notepad shortcut method used, is going to add microbes of delay also. A shortcut to a text file itself, that will eventually open a Notepad, will get to go through a fun process. Find the class bounce around in the registry, find the associated program, open that program, and pass in that parameter.

Most program shortcuts can have quoted whole paths "C:\Windows\notepad.exe", instead of using environment variables to eventually locate the program, in the many environment variable paths. Many programs like to stuff their program path into the environment variable path, they have even broken the "search path" there by making the line to long.

Most program shortcuts can also have quoted parameters placed after the quoted program path "d:\documents\todo.txt". This has the computer finding the file direct without searching or guessing, and passing the file to it immediately. (The quotes are only necessary when there are spaces.)

If you want to see speed, try it as "C:\Windows\notepad.exe" "d:\documents\todo.txt" and cut out the middleman. Create the shortcut for the program instead (notepad), and add a parameter for the .TXT file into the program shortcut. OK it's like DOS now. :-) But faster.

To check the environment variables (which is only for specific issues), go to "System", and in the "System Properties", in "Advanced" bring up the "Environment Variables" and look at the mess in the PATH variable.

2
  • Isn't this answer actually wrong?
    – Pacerier
    Jan 29, 2017 at 13:48
  • 1
    @Pacerier , which aspect of it did you concider to be incorrect? does it "solve" the original question? no accept. Does it reflect all the problems that exist with the shortcut system? , no. Is it about XP and win7? yes , was the original question about the windows 10 additional problems ? NO it is not, but it is cool that was covered.
    – Psycogeek
    Jan 31, 2017 at 18:59
6

The culprits for me are the "Movies & TV" and "Photos" app. Once I killed this 2 apps in task manager, my keyboard shortcut launched without the 3 seconds delay. Yes, I have to kill both.

I decided to uninstall both apps since I don't need them. To learn how to uninstall built-in apps, I have followed this page successfully:-

http://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-apps-and-how-to-reinstall-them/

6

For me (Windows 10 x64) helped disabling SuperFetch feature. This service (called SysMain in Services) is causing start of the Application Frame Host process several times per day and this process is responsible for slow shortcuts.

1

I cannot reproduce your problem and do not remember having it on any of my computers. I do not notice any difference to opening a shortcut by clicking. I have only very few of these shortcuts, though, 2 tops.

  • Is there a software that listens for hotkeys that is installed on all your rigs? Maybe this causes shortcuts to be recognized slowly? It could be any app with global hotkeys. You'd have to manually close them one by one to see if it makes any difference.
  • How many shortcuts do have? 10, 20, 30? If you have many, it could also mean slower reaction time.

To speed things up: You could try using a third party software for managing your shortcuts (like AutoHotkey, PhraseExpress or Clavier+ (all of which are available as aportable app). Hopefully, they will work faster. I am using them anyway and keep them on a flash drive to use on multiple computers.

1
  • Thanks for the answer. I've updated my question with some data.
    – cherouvim
    May 21, 2012 at 13:32
1

As this does not happen in Safe mode, and as I myself have never encountered such a slow-down, some product that you have installed must be causing the problem.

I suggest using Autoruns to turn off startup programs in bunches, until you narrow it down to the one that is causing it.

You could also examine your installed products using Revo Uninstaller Freeware and uninstall products that you don't need any more or that you don't like. Google carefully for products that you don't know.

I would also suggest, for the future, to install some security suite. There are lots of free antivirus products, as well as free anti-adware, and not having some of them is just asking for trouble, same as not locking your door at night.

I am not suggesting that your computer is infected, but that is one possibility for such a weird behavior, so full-scans using several well-known antivirus products would still be a good idea. See How to Clean An Infected Computer.

1

The reason for this is DDE. I don't know the specific technical details this problem generally boils down to a message queue meltdown.

Some applications are not expecting/able to handle DDE messages on an interrupt basis and so when something they ask for arrives or something is broadcasted to them they don't provide an instant response because they are not waiting on the queue. Things get backed up and everything with a dependency on DDE takes forever. In extreme cases even in command windows sometimes you can see letters you type will be lagged for the same reason.

The only way I know to avoid this problem is to avoid running certain applications over time and by trial and error you will notice when running cause delay. There might be a way to tweak things such as changing timeouts or isolation of DDE broadcast domains or tools to look into DDE but I am clueless on this topic.

1

I had a delay for 2 seconds, starting Notepad using Ctrl+Alt+N that I use to have as its shortcut key. The solution to get rid of the delay was to disable Akamai Netsession client.

To see if this is your problem, you can open Windows Task Manager, and select the "Netsession_win.exe", rightclik and select "End process tree". (There are two Netsession entries, one of them probabli spawning the other - selecting end process tree kills them both).

Now try your shortcut keys again.

If they are quick and nice now, make the change permanent either by uninstalling Akamai NetSession Interface from Add Remove programs in the control panel, or by disabling it in msconfig (so that it doesn't start automatically).

This is how to disable it by opening msconfig:

  • Start menu / Run / write "msconfig" / Enter.
  • Switch to the "Startup" tab.
  • Uncheck the entry with the name "Akamai Netsession Client".

However I'd uninstall it, and only install it again if it is needed. It's just a download agent that some companies use for downloading their software (I believe Microsoft and Adobe has used it).

This was the location of the akamai program:

c:\Users\myname\AppData\Local\Akamai\netsession_win.exe

Hope this will help out.

Best regards, Andreas

2
  • 2
    Thanks but I don't have anything Akamai related in my PCs.
    – cherouvim
    Jun 17, 2013 at 13:12
  • 1
    It might be some other program on your computer then. I had to go through almost all running services and processes on my computer – stopping the unnecessary ones – one by one, until I found the one (Akamai) that caused the delay. Windows has to "ask" every running process "Will you handle this shortcut key?", and if the process hesitates, and don't answer, it takes a few seconds. I found that explanation here: blogs.msdn.com/b/oldnewthing/archive/2012/05/02/10299709.aspx Reading the page again, it might be processes only – services has no windows. Have a look at startup tab in msconfig Jun 18, 2013 at 6:31
1

(Note: depending on your version of Windows, the Service once known as Superfetch is now known as SysMain.)

(I'm using Windows 10 64-bit Pro, version 19041.746.)

After I Disabled the SysMain Service, I had no delays [for a month] when using the keyboard shortcuts that I defined in the Properties dialog for most shortcuts on my desktop.

(For example, I right click the Excel shortcut icon, click Properties, click inside the Shortcut key textbox, and hold down the Ctrl, Alt, and x keys, whereupon Ctrl + Alt + X is pasted into the Shortcut key textbox. So when I press that 3-key combo, Excel opens immediately, with no delay.)

Disabling the SysMain service [once seemed] to be the global solution. Doing so seems to nail down one [of the] Windows components responsible for the delay instead of trying all the one-off "it worked for me"s.

I give credit to @icL7126, whose long-ago Answer is very short and thereby easily overlooked.

I found [some] info here. It suggests changes to the Registry. I wouldn't.

Will disabling SysMain cure your shortcut delay? Maybe not, but try it. You can always enable it again. (I'd hope you'd post failures to this thread.)

My own system performance [had] only been helped by disabling SysMain in that those delays between shortcut keypresses and program loading [had] disappeared for a month ... until ...

EDIT

... the 3-second delay started again last night. Very disappointing. I can no longer say, "Disabling the SysMain service did the trick," but that was the only change I'd made in December. So, now what.

Googling led me back to here so I read all the suggestions above (and elsewhere) and used Task Manager to stop cortana, which seemed insufficient, but I did it anyway to assert my dislike of it. More importantly, I found myself again at the posts by icl7126. I read everything else posted with that name and decided (since others swore by it) to stop the task named ApplicationHost.exe.

At the moment, there's no delay with SysMain still Disabled and with the ApplicationHost.exe task ended, but I expect, as icL7126 mentions, to have to do this several times per day until something better comes along.

0

I made a simple tool to execute hotkey shortcuts, which bypasses the Windows shell.

You can find it here: https://github.com/rustyx/myhotkey

I use it myself to rapidly start things like cmd.exe and bash.exe.

1
0

On a Win10 Pro machine, the culprit was the DropBox client loaded in the system tray. Right click and exit that and the 3 second problem went away.

Unfortunately, on the same PC upgraded to Win11 Pro, with no DropBox client installed, I saw the 3 second delay. I'll post back if I discover this particular offender.

Regards . . .

1
  • Hi Bret, this site does not work like a forum. Did you read the other answers? Aug 6, 2023 at 20:28
0

C# console app to immediately show you which apps are causing problems - an enhanced version, including sorted results and showing file paths, of Bob Mc's code from their 2016 comment link. Further code improvements are welcome.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace FindHotKeyDelay
{
    internal static partial class Program
    {
        /// <seealso href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-enumwindows" />
        [LibraryImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static partial bool EnumWindows(WndEnumProc lpEnumFunc, IntPtr lParam);

        /// <seealso href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getwindowtextlengthw" />
        [LibraryImport("user32.dll", SetLastError = true)]
        private static partial int GetWindowTextLengthW(IntPtr hWnd);

        /// <seealso href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getwindowtextw" />
        [LibraryImport("user32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
        private static partial int GetWindowTextW(IntPtr hWnd, [Out] char[] lpString, int nMaxCount);

        /// <seealso href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid" />
        [LibraryImport("user32.dll", SetLastError = true)]
        private static partial int GetWindowThreadProcessId(IntPtr handle, out uint processId);

        /// <seealso href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-sendmessagetimeoutw" />
        [LibraryImport("User32.dll", SetLastError = true)]
        private static partial IntPtr SendMessageTimeoutW(
            IntPtr hWnd,
            uint msg,
            UIntPtr wParam,
            IntPtr lParam,
            uint fuFlags,
            uint uTimeout,
            out UIntPtr lpdwResult);

        // EnumWindows callback method signature
        private delegate bool WndEnumProc(IntPtr hWnd, IntPtr lParam);

        private static async Task Main()
        {
            List<Task<(TimeSpan, string)>> hotKeyDelayTasks = new List<Task<(TimeSpan, string)>>();

            EnumWindows(delegate(IntPtr wnd, IntPtr _)
                {
                    hotKeyDelayTasks.Add(Task.Run(() => GetHotKeyDelay(wnd)));
                    return true;
                },
                lParam: 0);

            IEnumerable<string> messages = (await Task.WhenAll(hotKeyDelayTasks)).Order()
                .Select(delaysAndMessages => delaysAndMessages.Item2);

            foreach (string message in messages)
            {
                Console.WriteLine(message);
            }
        }

        private static (TimeSpan delay, string message) GetHotKeyDelay(IntPtr hWnd)
        {
            StringBuilder message = new StringBuilder();

            Stopwatch stopwatch = Stopwatch.StartNew();
            IntPtr sendMessageTimeoutReturnValue = SendMessageTimeoutW(
                hWnd: hWnd,
                msg: 0x0033, // WM_GETHOTKEY
                wParam: 0,
                lParam: 0,
                fuFlags: 2, // SMTO_ABORTIFHUNG
                uTimeout: 3000,
                lpdwResult: out UIntPtr _);
            stopwatch.Stop();

            if (sendMessageTimeoutReturnValue == 0)
            {
                message.Append("Fail or timeout ");

                if (Marshal.GetLastPInvokeError() != 0)
                {
                    WriteLastPInvokeErrorMessage();
                }
            }

            message.Append(stopwatch.Elapsed.ToString(@"s\.ffff\s\ "));

            if (GetWindowThreadProcessId(hWnd, out uint processId) == 0)
            {
                WriteLastPInvokeErrorMessage();
            }

            try // Accessing MainModule can throw access denied
            {
                Process process = Process.GetProcessById(checked((int)processId));
                message.Append(process.MainModule.FileName);
            }
            catch (Win32Exception exception)
            {
                message.Append(exception.Message);
            }

            int windowTextWithTerminatorLength = GetWindowTextLengthW(hWnd) + 1;
            if (windowTextWithTerminatorLength > 1)
            {
                char[] windowText = new char[windowTextWithTerminatorLength];
                if (GetWindowTextW(hWnd, windowText, windowTextWithTerminatorLength) == 0)
                {
                    WriteLastPInvokeErrorMessage();
                }

                message.Append($"\t{new string(windowText)}");
            }
            else
            {
                if (Marshal.GetLastPInvokeError() != 0)
                {
                    WriteLastPInvokeErrorMessage();
                }

                message.Append("\tno window title available");
            }

            return (stopwatch.Elapsed, message.ToString());
        }

        private static void WriteLastPInvokeErrorMessage()
        {
            Console.WriteLine(Marshal.GetLastPInvokeErrorMessage());
        }
    }
}
2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 3, 2023 at 9:07
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 3, 2023 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .