Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I wrote a script with AutoHotkey to minimize a current using windows task. Namely a sequence of key of Alt, Space, n activated by the press of the right Win key.

RWin::Send !{Space}n

It work perfectly with every software including Firefox but failed in Google Chrome. It just open the File menu and does nothing.

I also tried the following but it made things worse, all the software don't response correctly.

RWin::Send !{Space}
      Sleep, 100
      Send n
      return
share|improve this question
    
Does the key combination work when done manually? It works for me in Chrome under Windows 7, XP may be different for whatever reason. – Bob May 22 '12 at 8:53
    
Yes, it works when done manually. But I don't know why. – lamwaiman1988 May 22 '12 at 8:56
up vote 3 down vote accepted

You could use the WinMinimize, A command to minimise the active window:

RWin::WinMinimize, A

It's probably better than a sequence of keypresses that activate a context menu option. It apparently sends the same minimise message as the option on that context menu, or the minimise button (top right corner): SC_MINIMIZE.

Tested to work on Chrome 19.0.1084.46 m, Windows 7 x64, AHK 1.0.48.05.

share|improve this answer
    
Works like a charm. Thanks. – lamwaiman1988 May 23 '12 at 2:00

Make it:

RWin::Send {Alt}{Space}n

Tested and working with latest chrome on Windows 7 x64

share|improve this answer
    
Thing is, I tested his !{Space}n, which also works for me on Win7x64. Unless someone else can confirm this for XP, that slight difference in command probably won't help (who knows, this might actually work - it might be an odd bug). – Bob May 22 '12 at 10:17
    
Bob, I too tested !{Space}n. It works for all programs except chrome(I don't know why..) – tumchaaditya May 22 '12 at 10:52
    
Ok, that is odd. I'm running Chrome 19.0.1084.46 m, AHK 1.0.48.05. Perhaps a version specific issue. Or just something entirely random. – Bob May 22 '12 at 11:06
    
You may have to run an AHK script with Administrator privileges to override any keyboard hooks a program may be using. For example, Notepad++ is stubborn this way due to its macro features. – iglvzx May 22 '12 at 23:04
    
@iglvzx Chrome shouldn't be hooking the right Windows key. In fact, most programs shouldn't. Unless he has a plugin installed? (hint to OP: try disabling plugins to test) – Bob May 23 '12 at 0:08

You must log in to answer this question.

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