Page 1 of 1

show or hide taskbar

Posted: Mon Apr 10, 2006 9:25 am
by vincenz2004
Code updated for 5.20+

This really helped me, so I hope it helps someone else. It is the code to toggle the status of the windows (XP) taskbar (SHOW or HIDE):

Code: Select all

Procedure showtaskbar(tbstate.s)
  handleW1 = FindWindow_("Shell_traywnd", "")
  If(tbstate="S")
    SetWindowPos_(handleW1, 0, 0, 0, 0, 0, #SWP_SHOWWINDOW)
  EndIf
  If(tbstate="H")
    SetWindowPos_(handleW1, 0, 0, 0, 0, 0, #SWP_HIDEWINDOW)
  EndIf
EndProcedure

showtaskbar("S")
;showtaskbar("H")

Posted: Mon Apr 10, 2006 10:06 am
by srod
Hi, nice code.

Does this only work for Win XP or will it also work on Win 98 etc?

Regards.

Posted: Mon Apr 10, 2006 12:12 pm
by dige
better use the windows constants:

Code: Select all

; ShowWindow
SetWindowPos_(handleW1, 0, 0, 0, 0, 0, #SWP_SHOWWINDOW) 

; HideWindow
SetWindowPos_(handleW1, 0, 0, 0, 0, 0, #SWP_HIDEWINDOW) 

Posted: Thu May 18, 2006 8:55 pm
by lee__48
srod wrote:Hi, nice code.
Does this only work for Win XP or will it also work on Win 98 etc?
Regards.
I tested the following on Windows 2000 and 98. Works fine!

Code: Select all

SetWindowPos_(FindWindow_("Shell_traywnd", ""), 0, 0, 0, 0, 0, #SWP_HIDEWINDOW)
Delay(1200)
SetWindowPos_(FindWindow_("Shell_traywnd", ""), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW)