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?
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.