Hi
blehmeco
blehmeco wrote:
...got the script hiding the taskbar the 1st time it was executed, but not the next times; however, it worked fine using the hotkey
So the hotkey works perfectly, but not clicking the icon to run it?
blehmeco wrote:
Here's what i found: everytime i executed the script 4 the 2nd, or 3rd, etc. times it would re-load the script 2 the the tray causing the taskbar to temporarily come back (i'm talking miliseconds here), so, the "IfWinExists" command wouldn't work then!...obviously, when i suspected that was the problem, i just added the "#NoTrayIcon" and now IT'S WORKING!!! (wonder if that might be the reason 4 this command 2 not work with you a_h_k...care 2 check?)
I have checked, but my script (= different than yours) works whether #NoIcon is used or not
blehmeco wrote:
A little (very) intermittent bug: when coming back from the hidden taskbar, that is, when i restore the taskbar, the option 2 "Keep taskbar over other windows" gets toggled off...dunno why...
The following will leave "Always On Top" setting to what is currently is... (plus a couple of minor performance tweaks)
Code:
#NoTrayIcon
#SingleInstance force
DetectHiddenWindows, On
VarSetCapacity( APPBARDATA, 36, 0 )
; Fetch current hidden/showing status of taskbar
IfWinExist, ahk_class Shell_TrayWnd
x = 1
Else
x = 0
Gosub +z
Exit
+z::
x := Func(x)
Return
Func(x)
{
If x=0
{
NumPut( 0x0, APPBARDATA, 32, "UInt")
DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
WinShow ahk_class Shell_TrayWnd
Return 1
}
If x=1
{
NumPut( ( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
WinHide ahk_class Shell_TrayWnd
WinHide ahk_class Shell_TrayWnd
Return 0
}
}
Edit: Moved "DetectHiddenWindows, On" to top (
above 1st "IfWinExist". Realized that as it is, it will on the
first run always return "x = 0" (ie whether taskbar showing or hidden). So the
first run would have
never hidden the taskbar (?)