Show/Hide Windows Taskbar
// Get the task bar windowShow/Hide System tray child window
HWND hSysTrayWnd = ::FindWindow( "Shell_TrayWnd", 0 );
// Toggle the show or hidden status
if( ::IsWindowVisible( hSysTrayWnd ))
{
::ShowWindow( hSysTrayWnd, SW_HIDE );
}
else
{
::ShowWindow( hSysTrayWnd, SW_SHOW );
}
// Get the shell tray windowShow/Hide System Clock
HWND hSysTrayWnd = ::FindWindow ("Shell_TrayWnd", 0 );
if( hSysTrayWnd )
{
// Get the tray notification window
HWND hTrayNotifyWnd = ::FindWindowEx( hSysTrayWnd, 0, "TrayNotifyWnd", 0 );
if( hTrayNotifyWnd )
{
// Hide the tray notification window if shown or show if hidden
if( ::IsWindowVisible( hTrayNotifyWnd ))
{
::ShowWindow( hTrayNotifyWnd, SW_HIDE );
}
else
{
::ShowWindow( hTrayNotifyWnd, SW_SHOW );
}
}
}
// Get the shell tray windowShow/Hide Start button
HWND hSysTrayWnd = ::FindWindow( "Shell_TrayWnd", 0 );
if( hSysTrayWnd )
{
// Get the tray notification window
HWND hTrayNotifyWnd = ::FindWindowEx( hSysTrayWnd, 0, "TrayNotifyWnd", 0 );
if( hTrayNotifyWnd )
{
// Get the tray clock window
HWND hTrayClockWnd = ::FindWindowEx( hTrayNotifyWnd, 0, "TrayClockWClass", 0);
if( hTrayClockWnd )
{
// Hide the tray clock if shown or show if hidden
if( ::IsWindowVisible( hTrayClockWnd ))
{
::ShowWindow( hTrayClockWnd, SW_HIDE );
}
else
{
::ShowWindow( hTrayClockWnd, SW_SHOW );
}
}
}
}
// Get the shell tray window
HWND hSysTrayWnd = ::FindWindow( "Shell_TrayWnd", 0 );
if( hSysTrayWnd )
{
// Get the start button
HWND hStartBtn = ::FindWindowEx( hSysTrayWnd, 0, "Button", "start" );
if( hStartBtn )
{
// Hide the start button if shown or show if hidden
if( ::IsWindowVisible( hStartBtn ))
{
::ShowWindow( hStartBtn, SW_HIDE );
}
else
{
::ShowWindow( hStartBtn, SW_SHOW );
}
}
}
No comments:
Post a Comment