Link to home
Start Free TrialLog in
Avatar of Dominic34
Dominic34Flag for Canada

asked on

Remove task bar in Mobile 6

Hello,

I'm building an application in VB 2005 for a Pocket PC with Mobile 6.1. I'd like to get rid of the upper task bar when the application is running, so it'd takes all the screen. I tried the window maximized properties. It works, but when I enter a form and dispose it, the task bar comes back. I tried to force a maximized after the dispose, but it don't works. Like:

Dim oFrm As New FrmParameters
oFrm.ShowDialog()
=> to close the FrmParameters, I call the Dispose() method
Me.WindowState = FormWindowState.Maximized

every time I dipose a form and return to the main menu (of my application), the task bar comes back and overlap the main menu's form. what can I do?

thanks

Avatar of Mikal613
Mikal613
Flag of United States of America image

How do I hide maximize, minimize and close box at the form title bar?
To disable the maximize box at the form title bar, set the Maximize property of the form to false.

To disable the minimize box at the form title bar, set the Minimize property of the form to false.

You can not hide only the close box from the form title bar using the form’s property.

Similarly, you can not only hide maximize or minimize boxes from the title window.

You can hide maximize and minimize boxes from the title bar by setting the FormBorderStyle property of the form to the FixedToolWindow or the SizableToolWindow. But remember that with FormBorderStyle set to the FixedToolWindow or SizableToolWindow, the form will not be displayed in the Windows task bar or in the window that appears when the user presses ALT+TAB.

You can hide the Control box from the title bar of the form by setting the ControlBox property of the form to false. This will hide the control box and system menu from the form window.

From source:
http://webcache.googleusercontent.com/search?q=cache:HzpH1_wvm5sJ:www.programmersheaven.com/2/FAQ-WinForm-Hide-Min-Max-Close-Windows-Controls+pocket+pc+c%23+remove+minimize+maximize&cd=3&hl=en&ct=clnk&gl=us
Avatar of Dominic34

ASKER

thanks. but I should has mentionned that all my forms have the ControlBox property to false, maximized to True and FormBorderStyle to None. So the application takes all the screen and I don't want to see any task/menu bar.
you can employ the following approach (see code snippet, it's in C++/MFC, but can be easily converted into cf.net)

- use EnumWindows() Win32 API to enumerate existing windows and find the one with HHTaskBar
- disable and hide above window

the opposite steps are needed (except enumeration) to restore the things back
HWND g_hwndHHTaskbar = NULL;

BOOL IsOurs(CString& sWndName)
{
	if ( 
		sWndName.CompareNoCase(L"HHTaskBar") == 0
		//		 || sWndName.CompareNoCase(L"MS_PHONEIMEUI") == 0 
		//		 || sWndName.CompareNoCase(L"menu_worker") == 0
		)
		return TRUE;
	else
		return FALSE;
}

BOOL CALLBACK DisableTaskBar(HWND hwnd,LPARAM lParam)
{
	TCHAR szBuffer[64] = {0};
	CString sWndName;
	GetClassName(hwnd,szBuffer,64);
	sWndName = szBuffer;

	if ( IsOurs(sWndName) )
	{
		TRACE(_T("DisableTaskBar: %s\n"),sWndName);
		::ShowWindow(hwnd,NULL);
		::EnableWindow(hwnd,FALSE);
		g_hwndHHTaskbar = hwnd;
		return FALSE;
	}
	return (BOOL)hwnd;
}

BOOL CALLBACK EnableTaskBar(HWND hwnd,LPARAM lParam)
{
	TCHAR szBuffer[64] = {0};
	CString sWndName;
	GetClassName(hwnd,szBuffer,64);
	sWndName = szBuffer;

	if ( IsOurs(sWndName) )
	{
		TRACE(_T("EnableTaskBar: %s\n"),sWndName);
		::ShowWindow(hwnd,SW_SHOW);
		::EnableWindow(hwnd,TRUE);
	}
	return (BOOL)hwnd;
}


.....
// somewhere at the startup of your app
	EnumWindows(DisableTaskBar,NULL);

Open in new window

Hi alexey,

do you have the same code snippet in VB.net ??
ASKER CERTIFIED SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial