I open several programs on my Windows 8.1, including a web browser.

I constantly switch between other apps, and the web browser.

Is there a possibility to create a shortcut key combination that would immediately switch me to the browser?

Currently I use Alt+Tab.

  • if the browser is just recently used you can use Alt+Esc – phuclv Feb 6 '17 at 9:18
  • With AutoHotKey program you can assign your own hot key, something like that: F3::WinActivate, Firefox ; activate my browser – Alex Feb 6 '17 at 9:28
  • Thanks @Alex. More details or a whole script? – Danijel Feb 6 '17 at 9:42

If you have the browser pinned to the task bar, you can activate it using Win1Win9. This will either start the shortcut or activate its window when already open.

If you have a plain old .lnk shortcut, its "Properties" window lets you configure a CtrlAlt key, which also activates the program if already running.


(On OP request, I moved answer from comments here)

If you'd like to try 3rd party program, you may try AutoHotKey (let use abbreviation AHK further)
It is open sourced long living project that allow to assign in various way "Hot Keys" to any programs as well to operation system. It isn't limited to common Ctrl+ combinations but also allows creating phrase as string for various automation. It could be just a simple hot key assigner or full feature automation powerful scripts that may be used practically as replacement for bat, cmd, vbs, ps scripts.

The simplest usage case as OP asked - it could be just a single string in AHK script that looks like:

F4::WinActivate, ahk_exe /full/path/to/program_that_need_to_be_activated

Where F4 - a hot key (functional key on the keyboard), but can be practicality any combinations of keys and even strings.

It could be automated further, for example, - by pressing F4 activate required program and if it isn't running process then start and activate(set focus and bring it to front aka set Z index) this way script would looks like:

F4:: ; Comment: Use F4 key to activate or start firefox
  if WinExist("ahk_exe firefox.exe")
    WinActivate, ahk_exe firefox.exe
    Run, firefox.exe

; next is hot key for another program
; We assigning here Windows key + z to activate Notepad++
  np = C:\Program Files (x86)\Notepad++\notepad++.exe

  if WinExist("ahk_exe %np%")
    WinActivate, ahk_exe "%np%"
    Run, "%np%"

; Find and activate Firefox by Windows class by WinKey+x
DetectHiddenWindows, On
  fp = C:\Program Files\Mozilla Firefox\firefox.exe

  if WinExist("ahk_class MozillaWindowClass")
    WinActivate, ahk_class MozillaWindowClass
    Run, "%fp%"

AHK is pretty easy to setup and it comes with rich chm (help) file that cover a lot of user cases that include examples from how to set AHK GUI interface and up to using COM objects for automation. AHK scripts can be combined in a single script file or it can be multiple files that can be started on demand.

AHK supporting script compilation that simplify its distribution as compiled program that do the same as standalone AHK setup


Below is AHK solution for the Firefox with extension MinTrayR (that hide firefox in system tray)

I tried to find more elegant solution but after looking at MinTrayR source code, I found that it doesn't use WM_USER windows messages and accepts only standard OS messages that will require a lot of effort find correct handle of firefox button in system tray programmatically. While I believe it still possible, I used below another strategy: AHK script searching for particular image(firefox's icon in the system tray) on the screen and double click it on hot key pressing.
While it easy to implement it would require some initial steps on user's side:

  • Minimize Firefox (FF further). Make sure that FF icon is visible in sys.tray
    (In the Control Panel\All Control Panel Items\Notification Area Icons
    set Firefox status as Show icon and notification)
  • Press PrintScreen while the FF icon is visible in the system tray. (This places a screenshot on the clipboard.)
  • Open an image processing program such as Paint.
  • Paste the contents of the clipboard (that is, the screenshot).
  • Select a region that does not vary and that is unique to the Firefox's icon in the system tray. (Select it as close as possible to catch only globe with fox on it. Use zooming to precisely select icon's area )
  • Crop selected area and save it as C:\Users\Public\Pictures\ff.png

After that you can start using following AHK script to maximize Firefox from system tray or start a new instance of Firefox if it not running by pressing WinKey+v hot keys.

(If you using 32bits version of Firefox, replace string
C:\Program Files\Mozilla Firefox\firefox.exe with
C:\Program Files (x86)\Mozilla Firefox\firefox.exe)


    ffIconFile = C:\Users\Public\Pictures\ff.png
    fp = C:\Program Files\Mozilla Firefox\firefox.exe

    Process, Exist, %Processname%
    If !ErrorLevel
       MsgBox, % "Process " Processname " does not exist. Going to start a new one"
       Run, "%fp%"
    pid := ErrorLevel

    IfWinNotActive, % "ahk_pid " pid
        CoordMode Pixel
        ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %ffIconFile%

        if ErrorLevel = 2
            MsgBox Could not conduct the search (icon file path ?).
        else if ErrorLevel = 1
            MsgBox Firefox icon could not be found on the screen.
        {   ; MsgBox The icon was found at %FoundX%x%FoundY%.
            x := FoundX + 10
            y := FoundY + 10
            Click %x%, %y%, 0
            Click 2
  • This doesn't work becaue I use Firefox "Minimize to tray" plugin. When the plugin is disabled, all works OK. Too bad. – Danijel Feb 8 '17 at 9:01
  • Practically anything you can do from keyboard or mouse can be done with AHK. I don't have a choice to test it out now, but I added in my answer one more example where AHK looking for Windows class with option to find hidden windows. You may try it. – Alex Feb 8 '17 at 9:20
  • @Danijel Got a chance to test successfully the last solution ( Hot key for #x:: ) on one program that stay also in notification bar, so it should work with your plugin too. – Alex Feb 9 '17 at 15:13
  • Alex, unfortunatelly, it still doesn't work, opens up a new Firefox instance. The plugin is MinTrayR. – Danijel Feb 10 '17 at 6:36
  • 1
    It sounds like a challenge for me, I will try tomorrow this plugin and reply to you with results – Alex Feb 10 '17 at 9:18

This works the same as it did on Windows 7 and Windows 8.1.

You have to open the program application shortcut properties. There will be a field to enter a shortcut key combination. This will activate the shortcut which will in tern start the program application.

  1. Open the Start menu/screen, and click All apps and skip to 2. It if you are at the desktop, right click the start button and choose 'Explore All Users" which should open a window in the Program Data directory where their will be program application shortcuts. ie:C:\ProgramData\Microsoft\Windows\Start Menu\Programs If you see the program application hat you wish ti create the keyboard shortcut key for, skip to 4, if you do not see it skip to 3. ie:C:\ProgramData\Microsoft\Windows\Start Menu\Programs
  2. From at 'All Apps" from the start page, find the app you want to create a keyboard shortcut for and right-click it. A drop-down menu will appear. Click on the option Open "Open File Location", and move to step 4. (If you do not see an "Open file location" option, you're looking at either a native Windows 10 app or an app from the Windows Store - move to 3
  3. Right click and select "Create shortcut" or click on it and drag it from the Start menu onto the desktop to create a desktop shortcut.

  4. Locate the shortcut that you want to create the keyboard shortcut key for and Right click and choose "Properties".

  5. A Properties window will open. Under the Shortcut tab, you will see a field entry for Shortcut key. Click the textbox next to this line and then tap the desired shortcut key on your keyboard. The new shortcut will appear as Ctrl + Alt + [Key]. Click Apply (an 'Access Denied' window may pop up - click Continue to grant admin privileges and complete the operation).

  6. Once created the new shortcut key combination that opens the program will also switch to the program application if already opened.

  • OP's question isn't how to open a program with a shortcut key but to switch to an already open program, which the shortcut key in properties will not do. – wysiwyg Feb 6 '17 at 23:56
  • Ok, I forgot to put that part in and changed number 6 – Rich Manson Feb 7 '17 at 0:08
  • Have you tried it? It doesn't behave that way for me...it just opens a new instance of the program. – wysiwyg Feb 7 '17 at 0:09
  • Some apps I think call a new process while others check to see if one is already running. I'll have to check into that. – Rich Manson Feb 7 '17 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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