Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To open one or several files in a specific application i often select the file(s) in explorer and drag them to the target application.

My next step is always to perform some action on the recently opened file in the application dragged to, e.g. to perform a search in a text file opened in a text editor.

But the focus is still on the explorer window where the files were dragged from, so my actions are performed in the wrong window, e.g. pressing Ctrl+F launches a search in explorer instead of in the text editor.

This might sound like a small problem, but I perform this task tens, if not hundreds, of times per day, and can't seem to learn this unintuitive behavior!

Is there any way to modify this behavior? Perhaps with some AutoHotKey magic? Or some registry modifications?

share|improve this question

migrated from Oct 19 '12 at 19:51

This question came from our site for professional and enthusiast programmers.

Are you looking for Focus Follows Mouse ? – harrymc Jul 4 '15 at 10:12
@harrymc Excellent reference. I urge you to answer the question and include this reference. – misha256 Jul 6 '15 at 23:57

Windows does not have a feature for "Focus follows drop", but does have a feature for "Focus Follows Mouse" : When the mouse hovers over a window, it becomes the active window as far as the keyboard is concerned and is brought to the front of all other windows.

Under XP this feature is enabled using TweakUI.

In newer versions of Windows, this is built-into the Ease of Access Center ("Make the mouse easier to use" / "Activate a window by hovering over it with the mouse"). The excellent and free X-Mouse Controls can add a delay to the activation.

share|improve this answer
This would not work for me. I don't want to worry where I leave the cursor when I want to type something. It would be great if a program could intercept every drag-and-drop event and force focus change. – Josip Jul 7 '15 at 17:03
A AutoHotkey script can do that with only a few lines, although the script will need to be written. An example of tracking drag/drop events can be found in this thread, that you would need to first study and understand. – harrymc Jul 7 '15 at 18:10

The following registry setting would help in achieving it :

Use regedit to go to: HKEY_CURRENT_USER\Control Panel\Desktop.

Double-click on ForegroundLockTimeout and set its value in hexadecimal to 30d40.

Press OK and exit regedit.

Reboot your PC for the changes to take effect.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.