DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Finished Programs => Topic started by: brotherS on December 01, 2005, 08:21 AM

Title: DONE: use hotkey to minimize the active window
Post by: brotherS on December 01, 2005, 08:21 AM
Cross-post from https://www.donationcoder.com/forum/index.php?topic=1638 :

I did try Autohotkey some time ago, but the only thing I needed at the moment was minimizing currently active window on hotkey. I didn't find how to do it with Autohotkey in an hour, so now using Hotkeycontrol XP, which in fact has this function right out-of-the-box. Although, I open for suggestions on how to do this with Autohotkey.

I'm sure skrommel is able to come up with the code for this with the blink of an eye :)

I'd also like to add the code to my main script, there are times when this might come in handy!
Title: Re: IDEA: use hotkey to minimize the active window
Post by: skrommel on December 01, 2005, 09:45 AM
 :) Ctrl-M minimizes the active window.

^m::WinMinimize,A

Skrommel
Title: Re: IDEA: use hotkey to minimize the active window
Post by: wasker on December 01, 2005, 11:13 AM
Mmmm. Lovely. Thanks, guys! :)

The only question. I have a program that minimizes itself to tray. Neither Hotkeycontrol XP nor Autohotkey with this fantastic script can minimize it properly -- it always minimizes to taskbar. Although when I click Minimize button in window it does everything properly.

Any ideas on how to overcome this issue with Autohotkey? Any pointers too look for appreciated.

Thanks again!
Title: Re: IDEA: use hotkey to minimize the active window
Post by: skrommel on December 01, 2005, 01:16 PM
 :) You could use something like

^m::
IfWinActive,titleoftroublesomeprogram
  MouseClick,xposofminimizebutton,yposofminimizebutton
Else
  WinMinimize,A

Skrommel
Title: Re: IDEA: use hotkey to minimize the active window
Post by: brotherS on December 01, 2005, 02:32 PM
I'm sure skrommel is able to come up with the code for this with the blink of an eye :)

:) Ctrl-M minimizes the active window.

^m::WinMinimize,A
Ha! I knew it!! :D Thanks!