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

Dominic34Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mikal613Commented:
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
0
Dominic34Author Commented:
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.
0
alexey_gusevCommented:
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

0
Dominic34Author Commented:
Hi alexey,

do you have the same code snippet in VB.net ??
0
alexey_gusevCommented:
umm, not really, but I think I saw something at one of OpenNETFC sites or blogs, like this one:

http://blog.opennetcf.com/ayakhnin/CategoryView,category,Enumerate%20windows.aspx

I don't remember if OpenNetCF has already some classes for that, but you could check. I believe you would need P/Invoke anyway :)

here is a sample for desktop code, but you could use it anyway for EnumWindows:

http://www.pinvoke.net/default.aspx/user32.EnumWindows
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Smartphone Programming

From novice to tech pro — start learning today.