Windows XP shortcut key to focus a particular window

5

Say I've got several apps open and I want to keyboard shortcut to focus, or bring to the front, a particular window. Of course I know about alt+tab to cycle through windows, but it would be great to choose a specific window with a keyboard short cut.

conspirisi

Posted 2009-10-04T11:04:47.080

Reputation: 265

You should delete your post on SO. – Sinan Ünür – 2009-10-04T11:11:10.093

maximize means "expand the window to fill the screen". i think what you want is to raise a particular window, ie, "bring to front/focus". – quack quixote – 2009-10-04T11:17:11.267

sorry that's true, I'll edit question to make more sense – conspirisi – 2009-10-04T11:25:37.693

Answers

8

Autohotkey!

WinActivate, [Full Window Title]

If the window title changes, you can either use the bundled Window Spy to grab the ID, or

SetTitleMatchMode, 2

to be able to match a window with only a partial title. (There's also a regex mode, if you're comfortable with it).

The maximising would be WinMaximise rather than activate. This does not focus it, though, so you'd need to use both to maximise and focus a window.

EDIT:

Ok, real world example time.

#\::
   SetTitleMatchMode, 2
   WinActivate, is currently
return

That fire on winkey and \ (# being winkey), then focuses any window with "is currently" in the title. In this case, "User is currently status", for my IM windows.

Phoshi

Posted 2009-10-04T11:04:47.080

Reputation: 22 001

ok cool, I'll have to install software to do this then I guess. Is Autohotkey pretty simple to configure? – conspirisi – 2009-10-04T11:51:48.543

Yep. It loads any script with a .ahk extension - they're just text files, editable in any text editor. I'll update my post with a better example. – Phoshi – 2009-10-04T12:12:44.010

1

  • Make a shortcut to the application on the desktop

  • In that shortcut's properties, put your desired shortcut-key into the "Shortcut Key" field

Now with any other application focused, pressing that shortcut-key will start the shortcut.

If the application is already running, it will be given focus.

RJFalconer

Posted 2009-10-04T11:04:47.080

Reputation: 9 791

It will SOMETIMES be given focus, this changes per-app, and even then will have half a second or so of lag for disk read. – Phoshi – 2009-10-04T11:57:42.620

1Not true for all apps. Beyond what Phoshi mentions, some apps will start a second (or Nth) instance if their shortcut is activated again. It may be a viable solution for some particular app, however; test to be sure. – quack quixote – 2009-10-04T12:06:52.337

i like this, but it's not working for me for some reason though. – conspirisi – 2009-10-04T12:09:32.317

Yeah it lags for me a lot too. I've tested it on Vista only. I don't think there's another solution that doesn't involve some 3rd party app though. – RJFalconer – 2009-10-04T16:05:28.937

well there's always the "write your own" option, but this is SuperUsers, not StackOverflow... :) – quack quixote – 2009-10-04T18:22:12.000

1

This free utility does just that: MLHotKey:

MLHotKey is assigns hotkeys to any top level application. This means that once you assign a hotkey to a window, you can switch back to that window using the hokey, which is (usually) faster than the alt-tab chain.

Instructions:

  1. Start MLHotKey
  2. Select the window from the list to which you would like to assign a hotkey.
  3. Put the cursor in the text box above the command buttons.
  4. Type the key combination that you would like to set. (e.g. Ctrl+Alt+I)
  5. Press Set and you're done!

The hotkeys will "stick" even after you close MLHotKey. You can also remove a window's hotkey by selecting the window and clicking "Remove". The refresh button refreshes the list of windows.

There are some windows that will not accept hotkeys (Outlook 98 is one), and not all key combinations will work.

image

harrymc

Posted 2009-10-04T11:04:47.080

Reputation: 306 093

1

I agree with Phoshi about AutohotKey. I'm not sure if you want to focus the same particular window each time, or be able to choose. If the latter, then I'd recommend iswitchw. Also made with AHK, you can assign a key (caps lock by default) to show a window picker, and type the first letter or two and hit enter to select it.

outsideblasts

Posted 2009-10-04T11:04:47.080

Reputation: 6 297