[ Description ] :
It's basically an algorithm of animation to move the chosen window to the top of the screen. It's doesnt really hides the windows, it just moves to offscreen and creates a very natural effect of animation, based on golden number.
Enjoy!
Code:
#NoEnv
#SingleInstance Force
#Persistent
SetBatchLines,-1
SetKeyDelay,-1
SetWinDelay,-1
/*
conliek v01
by k3ph
*/
conliek(o,pid,s=30){
sysget, SM_CYSIZE, 31
sysget, SM_CYSIZEFRAME, 33
border := -(SM_CYSIZE + SM_CYSIZEFRAME)
wingetpos, x, y, w, h, ahk_pid %pid%
phi := (1+sqrt(5))/2
n := log((phi+h+(h*phi))/phi) / log(phi)
rn := round(n)
loop %rn% {
wingetpos, x, y, w, h, ahk_pid %pid%
if (o="hide" || o=1) {
ryl := round(-h + (phi**(rn-a_index)) - 1)
if (ryl <= -h) {
winmove, ahk_pid %pid%, , 0, -%h%
break
}
}
if (o="unhide" || o=0) {
ryl := round(-((phi**(rn-a_index))))
if (ryl >= border) {
winmove, ahk_pid %pid%, , 0, %border%
break
}
}
winmove, ahk_pid %pid%, , 0, %ryl%
sleep % s
}
}
; a very basic example
process=cmd.exe
run, %process%,,,pid
onexit exit
`:: ; shortcut key
switch := !switch
if switch
conliek(0,pid)
else
conliek(1,pid)
return
esc::
exit:
winclose ahk_pid %pid%
exitapp
example usage: simply press ` key after loading the script
update: thanks Heresy, we miss you.