Hi.
I wrote this some time ago, and I thought, that maybe I could share it, although it's not finished.
It's just a copy of the Windows Vista window preview, which shows up, when a taskbar button is hovered. The limitation of the script is that some apps need to be "seen" before, to draw them correctly. It also can't show minimized apps or grouped apps.
To run the script, you'll need COM Standard Library and ACC Standard Library by Sean (
http://www.autohotkey.com/forum/viewtopic.php?t=24234). You can edit it as much as you like.
Code:
#Include ACC.ahk
#Include COM.ahk
#NoTrayIcon
ExcludeList:="Mozilla Firefox" ;Seperate with a |
SetBatchLines, -1
SetWinDelay, -1
SetTitleMatchMode, 3
SetTitleMatchMode, Fast
ACC_Init()
Shown:=0
Stop:=0
WasMinimized=
LastWin=
SysGet, MonitorWorkArea, MonitorWorkArea, 1
WorkAreaH:=MonitorWorkAreaBottom
CoordMode, Mouse, Screen
OnExit, Close
Gui, +AlwaysOnTop +LastFound -Caption +Owner +E0x20
Gui, Show, w200 h200
GUI_ID:=WinExist()
WinSet, Transparent, 1, ahk_id %GUI_ID%
Sleep, 100
PrintWindow:=DllCall("GetProcAddress",UInt,DllCall
("GetModuleHandle",Str,"user32"),Str,"PrintWindow")
StretchBlt:=DllCall("GetProcAddress",UInt,DllCall
("GetModuleHandle",Str,"gdi32"),Str,"StretchBlt")
gdi32:=DllCall("LoadLibrary",Str,"gdi32.dll")
hdc_TMP:=DLLCall("GetDC", UInt, GUI_ID )
hdc_PreviewTMP := DllCall("CreateCompatibleDC", UInt,hdc_TMP)
hbm_PreviewTMP := DllCall("CreateCompatibleBitmap", UInt,hdc_TMP, Int,1024, Int,768)
selobj:=DllCall("SelectObject", UInt,hdc_PreviewTMP, UInt,hbm_PreviewTMP)
Gui, Hide
Hotkey, LButton, LButtonDown
Hotkey, LButton up, LButtonUp
Hotkey, LButton, Off
Hotkey, LButton up, Off
SetTimer, Loopp, 100
Return
Loopp:
MouseGetPos, X, Y, Title, Control
if(Title=WinExist("ahk_class Shell_TrayWnd"))
if(Control="ToolbarWindow323")
{
Stop:=0
if(Shown=X)
Stop:=1
if(Stop=0)
{
If Not pacc := ACC_AccessibleObjectFromPoint()
Return
If paccChild:=acc_Child(pacc, _idChild_)
sResult := acc_Name(paccChild), COM_Release(paccChild)
Else
sResult := acc_Name(pacc, _idChild_)
COM_Release(pacc)
if(sResult=LastWin)
Stop:=1
if(Stop=0)
{
IfWinExist, %sResult%
{
Win:=WinExist()
WinGet, Minimized, MinMax, ahk_id %Win%
if(Minimized>-1)
{
Loop, parse, ExcludeList, |
if(InStr(sResult, A_LoopField))
Return
Hotkey, LButton, On
Hotkey, LButton up, On
WinGetPos,,, w, h, ahk_id %Win%
scale:=200/w
w2:=200
h2:=h*scale
y:=WorkAreaH-h2
x2:=X-100
Gui, Show, NoActivate x%x2% y%y% w%w2% h%h2%
WinSet, Transparent, 1, ahk_id %GUI_ID%
Shown:=X
LastWin:=sResult
GetWindow(sResult, w, h, hdc_PreviewTMP, hdm_PreviewTMP, hdc_TMP, x2, y, w2, h2)
Sleep, 50
if(WasMinimized=sResult)
{
WasMinimized=
WinSet, Redraw, , %sResult%
}
WinSet, Transparent, 150, ahk_id %GUI_ID%
if(clickeddown=1)
{
Click up
Sleep, 25
Click up
clickeddown:=0
}
Hotkey, LButton, Off
Hotkey, LButton up, Off
}Else{
WinSet, Transparent, 1, ahk_id %GUI_ID%
Gui, Hide
Shown:=0
Stop:=0
WasMinimized:=sResult
LastWin=
}
}Else{
WinSet, Transparent, 1, ahk_id %GUI_ID%
Gui, Hide
Shown:=0
Stop:=0
LastWin=
}
}
}
}Else{
if(Shown<>0)
{
WinSet, Transparent, 1, ahk_id %GUI_ID%
Gui, Hide
Shown:=0
Stop:=0
LastWin=
}
}
Else{
if(Shown<>0)
{
WinSet, Transparent, 1, ahk_id %GUI_ID%
Gui, Hide
Shown:=0
Stop:=0
LastWin=
}
}
Return
GetWindow(Win, w, h, hdc_PreviewTMP, hdm_PreviewTMP, hdc_TMP, x2, y, w2, h2)
{
global PrintWindow, StretchBlt
DllCall(PrintWindow, UInt, WinExist(Win) , UInt,hdc_PreviewTMP, UInt, 0)
DllCall(StretchBlt, UInt,hdc_TMP, Int,0, Int,0, Int,w2, Int,h2, UInt,hdc_PreviewTMP, Int,0, Int,0,
Int,w, Int,h, UInt,0xCC0020)
}
LButtonDown:
Sleep, 150
clickeddown:=1
Click down
Return
LButtonUp:
Sleep, 200
clickeddown:=0
Click up
Return
Close:
COM_Release(psv)
ACC_Term()
DllCall("DeleteObject", UInt, selobj)
DllCall("DeleteDC", UInt, hdc_PreviewTMP)
DllCall("DeleteDC", UInt, hdc_TMP)
DllCall("FreeLibrary",UInt,gdi32)
ExitApp