-- hides taskbar on start-up,  restores on exit --
-- start demo --
include win32lib.ew

constant
    CYFULL = w32Func( xGetSystemMetrics, {SM_CYSCREEN} ), 
    Win = create( Window, "kick-taskbar", 0, 100, 0, 150, CYFULL, {WS_CAPTION, WS_SYSMENU} ), 
    -- new function !
    zFindWindow = registerw32Function( user32, "FindWindowA", {C_POINTER,  C_INT},  C_INT ) 

atom ptr,  ok,  taskbarhwnd

procedure hide_taskbar( integer self,  integer event,  sequence params )
  ptr = allocate_string( "Shell_TrayWnd" )
  taskbarhwnd = w32Func( zFindWindow, { ptr, NULL } )
  --call the ShowWindow() function to hide the taskbar
  ok = w32Func( xShowWindow, {taskbarhwnd, SW_HIDE } )
  free( ptr )
end procedure

-- you MUST do this on program exit to get the taskbar back ;-)
procedure restore_taskbar( integer self,  integer event,  sequence params )
  ok = w32Func( xShowWindow,  {taskbarhwnd,  SW_SHOW } )
end procedure

setHandler( Win,  w32HOpen,  routine_id( "hide_taskbar" ) )
setHandler( Win,  w32HClose,  routine_id( "restore_taskbar" ) )

WinMain( Win,  Normal )
-- end demo --
