k3ph
Joined: 20 Jul 2006 Posts: 174
|
Posted: Mon Aug 11, 2008 1:16 am Post subject: FPS console like: pseudo hide & unhide any window |
|
|
[ 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: | ; this example uses cmd.exe, to test it just load this script and run cmd.exe
#NoEnv
#SingleInstance Force
#Persistent
Critical,On
SetBatchLines,-1
SetKeyDelay,-1
SetWinDelay,-1
Thread, NoTimers
DetectHiddenWindows, On
CoordMode, Mouse, Screen
SetTitleMatchMode Regex
wintitle = cmd.exe ; change your title name here, can be ahk_
border = -22 ; this is my window title height, change it for your needs
goto hide
return
~':: ; shortcut key
switch := !switch
if switch {
goto unhide
} else {
goto hide
}
return
hide:
WinGetPos, X, Y, W, H, %wintitle%
phi := (1+sqrt(5))/2
n := log((phi+H+(H*phi))/phi) / log(phi)
rn := Round(n)
Loop %rn% {
WinGetPos, X, Y, W, H, %wintitle%
yl := -H + (phi**(rn-A_Index)) - 1
ryl := Round(yl)
if (ryl <= -H) {
WinMove, %wintitle%, , 0, -%H%
break
}
WinMove, %wintitle%, , 0, %ryl%
sleep 30 ; change to accelerate or desaccelerate
}
return
unhide:
WinGetPos, X, Y, W, H, %wintitle%
phi := (1+sqrt(5))/2
n := log((phi+H+(H*phi))/phi) / log(phi)
rn := Round(n)
Loop %rn% {
WinGetPos, X, Y, W, H, %wintitle%
yl := -((phi**(rn-A_Index)))
ryl := Round(yl)
if (ryl >= border) {
WinMove, %wintitle%, , 0, %border%
break
}
WinMove, %wintitle%, , 0, %ryl%
sleep 30 ; change to accelerate or desaccelerate
}
return |
[ Notes ] :
Note1: yeah there are some limitations in this version. I need to improve some features like spam key detect, region detect, positive border, move to any direction, bounce effect etc. Maybe i'll update it soon :)
Note2: my preferred speed is around [23,25] _________________ [ profile | ahk.net | ahk.talk ] |
|