well that's strange. my first script sets a window to be always on top and my second script which creates a tooltip displaying windows styles doesn't show the appropriate exstyle. here's the code to set a window always on top. (it was also designed to fade all windows but the active window. it's fully functional.
Code:
#persistent
settimer, transman, 100
onexit, exiter
transstart()
return
^!a::
mousegetpos,,,win
wingettitle, title, ahk_id %win%
winset, AlwaysOnTop,TOGGLE, ahk_id %Win%
if instr(title, " - Always on top")
winsettitle, ahk_id %win%,,% substr(title, 1, instr(title, " - Always on top"))
else winsettitle, ahk_id %win%,,%title% - Always on top
return
transman: ;***
makemtrans()
return ;*
exiter: ;***
winget, allwindows, list
Loop, %allwindows% {
win := allwindows%A_index%
wingettitle, tit, ahk_id %win%
wingetclass, cls, ahk_id %win%
if a_index = 1
wingettitle, activetit, A
if isitlegal(cls) and !(tit = activetit) {
winset, Transparent, OFF, ahk_id %win%
}
}
exitapp
return ;*
;fix always on top mover
;fix for active windows that shouldn't change transparency eg (find dialogues)
transstart() {
loop, 200
{
thistime := a_index
winget, allwindows, list
Loop, %allwindows% {
win := allwindows%A_index%
wingettitle, tit, ahk_id %win%
wingetclass, cls, ahk_id %win%
if a_index = 1
wingettitle, activetit, A
if isitlegal(cls) and !(tit = activetit)
winset, Transparent,% 255 - thistime, ahk_id %win%
}
}
oldwin := newwin
}
makemtrans() {
static oldwin
winget, newwin,, A
if !(newwin = oldwin) {
loop, 200
{
if a_index = 1
wingetclass, cls, ahk_id %oldwin%
if isitlegal(cls)
winset, Transparent,% 255 - a_index, ahk_id %oldwin%
if a_index = 1
wingetclass, cls2, ahk_id %newwin%
if isitlegal(cls2)
winset, Transparent,% 55 + a_index, ahk_id %newwin%
}
}
oldwin := newwin
}
isitlegal(cls) {
wingettitle, activetit, A
return !(cls = "Button") and
!(cls = "Progman") and
!(cls = "SynTrackCursorWindowClass") and
!(cls = "Shell_TrayWnd")
}
and here is the code I used to test exstyles
Code:
#persistent
settimer, thing, on
return
thing:
mousegetpos, x, y, win
WinGet, ExStyle, ExStyle, ahk_id %win%
tooltip, %exstyle%, % x + 5, % y + 5
return
go ahead and make a window always on top by activating it and pressing control + alt + a, then run the exstyle checking script and you may see that the styles don't match. I tested by making windows media player 11 always on top (it is transparent) though that doesn't affect the exstyle.
any ideas?