Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Min2Tray v1.7.9 - minimize window to tray & much more!


  • Please log in to reply
224 replies to this topic
Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005
And another one!

my contribution to the ahk community:
Min2Tray (v1.7.9, 2011/10/11)

minimize a window to system tray area of taskbar as icon.
BossKey feature for minimizing several windows at once.
make window always-on-top and maximize window vertically
or horizontally. StartupMinimize can hide certain windows
upon start of Min2Tray or assign actions. and much, much more!
requires ms windows nt/2000/xp/vista/7 or newer - not tested under win 8, yet ;-)

partial changelog for Min2Tray v1.7.9:
+ new feature: use right mouse click on the close button of the window's titlebar to minimize it.
* replaced some functions by much faster routines from Forms Framework v0.8 by majkinetor. this speeded up systray icon creation and other things enormously!

please use it, test the new features extensively, give reply and suggest new features or implement them yourself :p

thx...
Junyx

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I looked at the package you put together and it seems quite useful and well explained. Thanks for sharing your work.

skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
:oops: Why didn't I think of that? One script is much better than my two script attempt in http://www.autohotke...hlight=skrommel. Nice, Junyx!

Skrommel

Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005
well, nothing is perfect. the same for my script. :wink:

currently i'm looking for a way to only allow one instance of the "main" program to be started and run.
"#singleinstance on" doesn't work due to the 2-in-1 script (it has to be started several times as "helper").

any ideas?

Junyx

skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
None. You need multiple instances to show multiple icons.

Skrommel

TheLeO
  • Members
  • 264 posts
  • Last active: Jan 02 2012 01:51 AM
  • Joined: 11 Jun 2005
qiet nifty,,. thanx
::
I Have Spoken
::

Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005
look at the topmost message! :roll:

Junyx

twhyman
  • Members
  • 348 posts
  • Last active: Sep 17 2014 01:55 AM
  • Joined: 07 Dec 2005
file not found , cant download...

twhyman
  • Members
  • 348 posts
  • Last active: Sep 17 2014 01:55 AM
  • Joined: 07 Dec 2005
does someone has this file?

mE
  • Guests
  • Last active:
  • Joined: --
Can't load it too...

Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005

does someone has this file?


sorry for the inconvenience, folks :shock:
have just updated the file location...

Junyx

twhyman
  • Members
  • 348 posts
  • Last active: Sep 17 2014 01:55 AM
  • Joined: 07 Dec 2005
hi,

thanks for posting the script back :)

iam a total noob at AHK ,can u help me integrate the script so i can make my application minimize to tray?

do i need the whole script for that?

thanks
Twhyman

Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005

iam a total noob at AHK ,can u help me integrate the script so i can make my application minimize to tray?

do i need the whole script for that?


well, in order to get a tray icon for the minimized windows you have to start a new instance of AHK - everytime. that's the catch.

1) you need to place my script somewhere (i.e. in the directory where your script is located).

2) include this in your script:
Min2TrayGo:
  WinWait, A,, 2			; set "last used window"
  If ( ErrorLevel )	; It timed out, so do nothing
     Return

  WinGet, h_WinStyle, Style
  
  ; checks for minimizable window: (WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
  If ( h_WinStyle & 0xCA0000 = 0xCA0000 )
  {
  	WinGet, h_ID, ID
 		Run, C:\AutoHotkey\AutoHotkey.exe C:\AutoHotkey\Min2Tray\Min2Tray.ahk %h_ID%, , UseErrorLevel
  	If ( ErrorLevel = "ERROR" )	; helper could not be started
  		Return
  }
Return
change paths to my script and AHK.exe according to your needs!

3) to hide the window and create a tray icon just call in your prog:
Gosub, Min2TrayGo

that should do it for you.
please do make your program public domain or GPLv2 and give some credit :-)

Junyx

Junyx
  • Members
  • 124 posts
  • Last active: Nov 01 2015 06:37 PM
  • Joined: 11 Jul 2005
:p

ezuk
  • Members
  • 149 posts
  • Last active: Jan 02 2013 08:54 AM
  • Joined: 04 Jun 2005
For your info: Doesn't work for me when I put the script in a long path (with spaces in it) such as C:\My Documents\AHK\Scripts .