This is a script I've been using for a while – I prefer my Windows XP setup with the taskbar on top, but unfortunately there are numerous Windows programs which assume the taskbar will always be on the bottom.
As a result, those programs often place their windows with title bars directly underneath my taskbar – requiring a lot of repeated hassle to get those windows out from under it.
This script takes care of this problem for you – I leave it running all day, and it automatically moves any badly-placed windows out from under the taskbar for me. I'm hopeful that others will also find this little program useful!
opt('mustDeclareVars',1)
func fixWindows($aWinList,$nWidth,$nHeight)
for $i=1 to $aWinList[0][0]
local $hwnd=$aWinList[$i][1]
local $pos=winGetPos($hwnd)
if isArray($pos) then
local $x=$pos[0],$y=$pos[1],$winWidth=$pos[2],$winHeight=$pos[3]
if $x<=0 and $y<=0 and $winHeight>=(@DesktopHeight-4) then
; don’t move this window – something covering the whole screen is probably meant to be there
elseif $x<$nWidth and $y<$nHeight then
; move this window out from under the taskbar
winMove($hwnd,"",$x,$nHeight)
endif
endif
next
endfunc
func start()
local $aTaskbarPos,$trayWidth,$trayHeight
do
sleep(2000) ; check every two seconds
$aTaskbarPos=winGetPos('[CLASS:Shell_TrayWnd]')
until isArray($aTaskbarPos)
if $aTaskbarPos[1]>0 then
; taskbar is not at the top of the screen, quit
exit
endif
$trayWidth=$aTaskbarPos[0]+$aTaskbarPos[2]-32 ; allow for windows mostly on the other side of the taskbar (for dual monitor setup)
$trayHeight=$aTaskbarPos[1]+$aTaskbarPos[3]-4
while true
sleep(2000) ; check every two seconds
fixWindows(winList(),$trayWidth,$trayHeight)
wend
endfunc
start()keepWindowsClearOfTopTaskbar.7z