AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FPS console like: pseudo hide & unhide any window

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
k3ph



Joined: 20 Jul 2006
Posts: 174

PostPosted: Mon Aug 11, 2008 1:16 am    Post subject: FPS console like: pseudo hide & unhide any window Reply with quote

[ 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 ]
Back to top
View user's profile Send private message
BoBo²
Guest





PostPosted: Mon Aug 11, 2008 2:54 pm    Post subject: Reply with quote

Nice! Thx 4 sharing it. Very Happy
Back to top
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Mon Aug 11, 2008 3:36 pm    Post subject: Reply with quote

Thanks i like it border can be replaced with following

Code:
SysGet, SM_CYSIZE, 31
SysGet, SM_CYSIZEFRAME, 33
Border := -(SM_CYSIZE + SM_CYSIZEFRAME)

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group