twhyman wrote:
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:
Code:
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:
Code:
Gosub, Min2TrayGo
that should do it for you.
please do make your program public domain or GPLv2 and give some credit
Junyx