WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Autohide Taskbar Code


I assume this code to Autohide the Task Bar would still work under XP, it was fine under 98 years ago.

:1500ChkAutoHide
ABM_GETSTATE = 4
;flags - 3 = autohide and always on top, etc
ABS_AUTOHIDE = 1
ABS_ALWAYSONTOP = 2

tSize = 50
t = BinaryAlloc(tSize)
cbSizeOffset = 0
hwndOffset = 4
uCallbackMessageOffset = 8
uEdgeOffset = 12
rcOffset = 16
lParamOffset = 32
LastError() ;clear the errors
Errormode(@off) ;tell WB we'll handle the errors
BinaryPoke4(t, cbSizeOffset, 36)
ErrorMode(@cancel)
If LastError( ) != 0 Then
If Quiet=="N" Then
Message ("SetupBP: Need to set AutoHide","Please set the Taskbar to Autohide on this PC. Error 4.")
EndIf
Return
Endif

Request = ABM_GETSTATE
Gosub 1600GetHWnd
errormode(@off)
BinaryPoke4(t, hwndOffset, hwnd)
dllhnd = DllLoad(StrCat(DirWindows(1),"shell32.dll"))
result = DllCall(dllhnd, long:"SHAppBarMessage", Long:Request, lpbinary:t)
Select @True
Case Result == 0 || Result == 2
;Message("Taskbar status", "Autohide is off")
NeedToHide = @True
Break
Case Result == 1 || Result == 3
;Message("Taskbar status", "Autohide is on")
Break
Case @True
Message ("SetupBP: Need to set AutoHide C","Please set the Taskbar to Autohide on this PC. Error C.")
break
end select
BinaryFree(t)
DllFree(dllhnd)
errormode(@cancel)
Return

:1600GetHWnd
AddExtender("WWCTL44i.DLL")
AddExtender("wilx44i.dll")
moi=DllHwnd("")
thiswnd=cWndInfo(moi,4)
while thiswnd!=0
class=cWndInfo(thiswnd,2)
if class=="Shell_TrayWnd" 
hwnd = thiswnd
hexwnd=xBaseConvert(thiswnd,10,16)
hexwnd=StrFixLeft(hexwnd,"0",8)
hexwnd=strcat("#WIN$ID#",hexwnd)
break
endif
thiswnd=cWndInfo(thiswnd,6)
endwhile
return 

Article ID:   W16985
File Created: 2007:07:03:14:27:30
Last Updated: 2007:07:03:14:27:30