Drugwash wrote:
The button picture needed additional code to resize according to GUI size. That was not important at the time. Anyway, since it works, let's keep it as is, until I figure out the rest.
Code:
#NoTrayIcon
ControlGetPos, bx, by, bw, bh, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
Gui, -Caption +ToolWindow -Border +AlwaysOnTop
Gui, Margin, 0, 0
Gui, Show, x%bx% y%by% w%bw% h%bh%, showdesktop
WinGet, hSplash, ID, showdesktop
WinSet, TransColor, White, showdesktop
WinSet, AlwaysOnTop, On, showdesktop
WinGet, hSplash, ID, showdesktop
WinGet, hShell, ID, ahk_class Shell_TrayWnd
DllCall("SetParent", "UInt", hSplash, "UInt", hShell)
OnMessage(0x201, "WM_LBUTTONDOWN")
WinGet, L, List
Loop, % L
{
WinGetTitle, T, % "ahk_id " L%A_Index%
If(ProcessGet_PID("AutoHotkey.Exe") == WinGet_PID(L%A_Index%))
WinSet, Style, -0x8000000, % "ahk_id " L%A_Index%
}
Return
WM_LBUTTONDOWN()
{
Send, {LWin down}{m}{LWin up}
}
ProcessGet_PID(P) {
Process, Exist, % P
Return ErrorLevel
}
WinGet_PID(W) {
WinGet, I, PID, % "ahk_id " W
Return I
}
Return
Maybe some quick fix,to reload after 1 second if resolution is changed?