1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hide/Show the Windows 7 Taskbar and StartButton

Discussion in 'T&T - Scripting' started by Joe Caverly, Aug 9, 2017.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    659
    Likes Received:
    8
    Code:
    @setlocal
    @echo off
    ::
    :: Batch file to Hide/Show the Windows 7 Taskbar, and StartButton
    ::
    :: TODO: More error checking
    ::
    iff %# eq 0 then
      echo USAGE: %_BATCHNAME [Hide] [Show]
      quit
    endiff
    set SW_HIDE=0
    set SW_SHOW=1
    set hwndTaskBar=%@winapi[user32,FindWindow,"Shell_TrayWnd",""]
    set hwndStartButton=%@winapi[user32,FindWindow,"Button","Start"]
    iff %1 eq hide then
      set rc=%@winapi[user32,ShowWindow,%hwndTaskBar,%SW_HIDE]
      set rc=%@winapi[user32,ShowWindow,%hwndStartButton,%SW_HIDE]
    endiff
    iff %1 eq show then
      set rc=%@winapi[user32,ShowWindow,%hwndTaskBar,%SW_SHOW]
      set rc=%@winapi[user32,ShowWindow,%hwndStartButton,%SW_SHOW]
    endiff
    endlocal
    
     
  2. w_krieger

    Joined:
    Nov 2, 2008
    Messages:
    175
    Likes Received:
    0
    This batch works with 'taskbar Show', when the windows 7 hides its taskbar on screen-blank. 'Tis useful.
     
    #2 w_krieger, Aug 11, 2017
    Last edited: Aug 19, 2017
  3. w_krieger

    Joined:
    Nov 2, 2008
    Messages:
    175
    Likes Received:
    0
    Many fixes.

    Code:
    :: TODO: More error checking - fixed.  Either show or hide,
    ::  or it produces an error message. 
    ::
    setlocal
    set SW_HIDE=0
    set SW_SHOW=1
    set hwndTaskBar=%@winapi[user32,FindWindow,"Shell_TrayWnd",""]
    set hwndStartButton=%@winapi[user32,FindWindow,"Button","Start"]
    iff d%1 eq dhide then
      set rc=%@winapi[user32,ShowWindow,%hwndTaskBar,%SW_HIDE]
      set rc=%@winapi[user32,ShowWindow,%hwndStartButton,%SW_HIDE]
    elseiff d%1 eq dshow then
      set rc=%@winapi[user32,ShowWindow,%hwndTaskBar,%SW_SHOW]
      set rc=%@winapi[user32,ShowWindow,%hwndStartButton,%SW_SHOW]
    else
      echo USAGE: %_BATCHNAME [Hide] [Show]
    endiff
    endlocal
    
     

Share This Page