hide the task bar and input panel in Windows Mobile
2009-07-15 17:17
549 查看
when
develop the WM apps sometimes we need to hide the task bar and input panel.
here
some methods are introduced with both C++ and C#.
C++:
by
the function SHFullScreen(), we may hide and show the taskbar, Input Panel
button, or Start menu icon.
and
it's easy to use.
//
hide
void
CHideInputDlg::OnBnClickedButton1()
{
BOOL bRet = false;
RECT rc;
DWORD dwState = (SHFS_HIDETASKBAR |
SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
bRet = SHFullScreen(m_hWnd, dwState);
// Next resize the main window to the size
of the screen.
SetRect(&rc, 0, 0,
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
MoveWindow(rc.left, rc.top, rc.right-rc.left,
rc.bottom-rc.top, TRUE);
}
//
show
void
CHideInputDlg::OnBnClickedButton2()
{
BOOL bRet = false;
RECT rc;
DWORD dwState = (SHFS_SHOWTASKBAR |
SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
bRet = SHFullScreen(m_hWnd, dwState);
// Next resize the main window to the size
of the work area.
SystemParametersInfo(SPI_GETWORKAREA, 0,
&rc, FALSE);
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
SDK
link:
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.WindowsMobile.6/WindowsMobile6SDK/html/8d06e91f-a53f-4a09-add0-d7c25b589a9c.htm
and
there is another more classical way to hide or even disable the task bar: find
it's handle and do what ever we want. But the method doesn't work for input
panel.
//
hide
void
CHideInputDlg::OnBnClickedButton3()
{
HWND pWin = NULL;
pWin =
::FindWindowW(_T("HHTaskBar"), _T(""));
::ShowWindow(pWin, SW_HIDE);
//::EnableWindow(pWin, FALSE);
RECT rc;
SetRect(&rc, 0, 0,
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
//
show
void
CHideInputDlg::OnBnClickedButton4()
{
HWND pWin = NULL;
pWin =
::FindWindowW(_T("HHTaskBar"), _T(""));
::ShowWindow(pWin, SW_SHOW);
RECT rc;
SystemParametersInfo(SPI_GETWORKAREA, 0,
&rc, FALSE);
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
by
the way notes that both the height of task bar and the input panel are 26.
C#
while
in the C# platform, the work is much easier,
just
change the property of the form:
FormBorderStyle: None;
WindowState: Maximized;
Size:
your
screen size;
by
the setting, the task bar is covered, put the input panel is still there, cause
the panel is associated with the component MainMenu, just delete the component,
we would get a clean screen.
develop the WM apps sometimes we need to hide the task bar and input panel.
here
some methods are introduced with both C++ and C#.
C++:
by
the function SHFullScreen(), we may hide and show the taskbar, Input Panel
button, or Start menu icon.
and
it's easy to use.
//
hide
void
CHideInputDlg::OnBnClickedButton1()
{
BOOL bRet = false;
RECT rc;
DWORD dwState = (SHFS_HIDETASKBAR |
SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
bRet = SHFullScreen(m_hWnd, dwState);
// Next resize the main window to the size
of the screen.
SetRect(&rc, 0, 0,
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
MoveWindow(rc.left, rc.top, rc.right-rc.left,
rc.bottom-rc.top, TRUE);
}
//
show
void
CHideInputDlg::OnBnClickedButton2()
{
BOOL bRet = false;
RECT rc;
DWORD dwState = (SHFS_SHOWTASKBAR |
SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
bRet = SHFullScreen(m_hWnd, dwState);
// Next resize the main window to the size
of the work area.
SystemParametersInfo(SPI_GETWORKAREA, 0,
&rc, FALSE);
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
SDK
link:
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.WindowsMobile.6/WindowsMobile6SDK/html/8d06e91f-a53f-4a09-add0-d7c25b589a9c.htm
and
there is another more classical way to hide or even disable the task bar: find
it's handle and do what ever we want. But the method doesn't work for input
panel.
//
hide
void
CHideInputDlg::OnBnClickedButton3()
{
HWND pWin = NULL;
pWin =
::FindWindowW(_T("HHTaskBar"), _T(""));
::ShowWindow(pWin, SW_HIDE);
//::EnableWindow(pWin, FALSE);
RECT rc;
SetRect(&rc, 0, 0,
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
//
show
void
CHideInputDlg::OnBnClickedButton4()
{
HWND pWin = NULL;
pWin =
::FindWindowW(_T("HHTaskBar"), _T(""));
::ShowWindow(pWin, SW_SHOW);
RECT rc;
SystemParametersInfo(SPI_GETWORKAREA, 0,
&rc, FALSE);
MoveWindow(rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, TRUE);
}
by
the way notes that both the height of task bar and the input panel are 26.
C#
while
in the C# platform, the work is much easier,
just
change the property of the form:
FormBorderStyle: None;
WindowState: Maximized;
Size:
your
screen size;
by
the setting, the task bar is covered, put the input panel is still there, cause
the panel is associated with the component MainMenu, just delete the component,
we would get a clean screen.
相关文章推荐
- Use Unicode and Hide the Console in Windows
- How to hide the address bar in MobileSafari
- Customize the Places Bar in Office 2000 and Office XP
- Creating the Same Program in Windows Forms and WPF
- Changes in behavior of the SysPrep and RIPREP tools after you install Windows XP Service Pack 2
- How to programmatically remove/hide the system bar in Honeycomb (requires root)
- How to get the running applications in windows task manager using powershell
- User Input - Filling In Forms,Moving Between Windows and Frames
- The difference between Web role and Worker role in windows azure platform
- Android Hide the title bar in 2 ways
- How to use the Windows Azure Mobile Services (WAMS). With WAMS, signing in via Microsoft, Facebook, Twitter, and Google
- [转]Installing, Configuring and Using Windows Server AppFabric and the "Velocity" Memory Cache in 10 minutes
- Windows Integrated Authentication in the combination of IIS and Tomcat
- calling the OPENSSL libs in windows mobile
- How to Change the Icon for a File Type in Windows 7 and Vista(转)
- The min/max problem in C++ and Windows
- Changes in behavior of the SysPrep and RIPREP tools after you install Windows XP Service Pack 2
- Install the IIS 6.0 Management Compatibility Components in Windows 7 or in Windows Vista from Control Panel
- 怎样控制Qt标题栏(How can I handle events in the titlebar and change its color etc ? )
- Hide Title Bar in C Windows Programming