Jump to content


Photo

how to hide taskbars so it doesn't flickering thru gapi

- - - - -

  • Please log in to reply
No replies to this topic

#1
muff

muff

    Addict

  • MoDaCo Gold
  • PipPipPipPipPip
  • 938 posts
an example piece of code to help people out

// to hide taskbar(s) - use after creating the game window or when restoring a minimised app

	 TaskbarShow( false );

// to allow taskbar(s) to be seen again - use when minimising or exitting the app

	  TaskbarShow( true );


// this function hides and shows the taskbars on the system
// historically this was here to stop the flickers of the icons on the top taskbar
// that we were getting on the first smartphones
// I'm not 100% sure that it's necessary on newer devices

void TaskbarShow( bool show )
{
	RECT rc;
	::GetWindowRect(hWnd, &rc );

	HWND hWndTB = ::FindWindow(_T("HHTaskbar"), NULL);
	if (hWndTB == NULL)
	{
		hWndTB = ::FindWindow(_T("Tray"), NULL);
	}

	if (show)
	{
		::ShowWindow( hWndTB, SW_SHOW );	
		::SHFullScreen( 0, SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON);
	}
	else
	{
		::SHFullScreen( hWndTB, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
		::ShowWindow( hWndTB, SW_HIDE );
	}
}


hope that helps

muff

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users