[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);
<DllImport "aygshell.dll", SetLastError:=True)> _
Public Shared Function SHFullScreen( hWnd as IntPtr, flags as Integer ) as Integer
End Function
const uint SHFS_SHOWTASKBAR = 0x0001;
const uint SHFS_HIDETASKBAR = 0x0002;
const uint SHFS_SHOWSIPBUTTON = 0x0004;
const uint SHFS_HIDESIPBUTTON = 0x0008;
const uint SHFS_SHOWSTARTICON = 0x0010;
const uint SHFS_HIDESTARTICON = 0x0020;
SHFS_SHOWTASKBAR
Return the taskbar to its topmost state.
SHFS_HIDETASKBAR
Put the taskbar at the bottom of the z-order. Note that a game or an application that requires take-over of the entire screen may use this flag. It is the responsibility of the application to make sure it is sized FULL SCREEN before using this flag. Otherwise, it will appear as though the function did nothing.
SHFS_SHOWSIPBUTTON
Return the Input Panel button to its visible state.
SHFS_HIDESIPBUTTON
Hide the Input Panel button.
SHFS_SHOWSTARTICON
Return the Start button icon to the navigation bar.
SHFS_HIDESTARTICON
Hide the Start button icon on the navigation bar. When the Start icon is hidden, the shell is in a special state in which clicking or tapping the navigation bar will not display the drop-down Start menu. The navigation bar is essentially disabled when in this state. While in this mode, WM_LBUTTONDOWN and WM_LBUTTONUP messages will be forwarded to hwndRequester. This allows an application to drop out of this mode by calling this function with the SHFS_SHOWSTARTICON, when the user clicks or taps the navigation bar.
Take into account that this function is glitchy, at best. If you have a single form application it's OK, but if your application is multi-form, or launches other processes you can see the taskbar briefly, showing an undesirable flickering effect.
Important Note: This function only works for Pocket PC, not Windows CE.
const uint SHFS_SHOWTASKBAR = 0x0001;
const uint SHFS_HIDETASKBAR = 0x0002;
const uint SHFS_SHOWSIPBUTTON = 0x0004;
const uint SHFS_HIDESIPBUTTON = 0x0008;
const uint SHFS_SHOWSTARTICON = 0x0010;
const uint SHFS_HIDESTARTICON = 0x0020;
[DllImport("aygshell.dll")]
static extern bool SHFullScreen(IntPtr hwndRequester, uint dwState);
[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();
private bool TaskBarOnOff(bool OnOff)
{
Capture = true;
IntPtr hwnd = GetCapture();
Capture = false;
if(OnOff)
return SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
else
return SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON | SHFS_SHOWSTARTICON);
}
Functions for doing the same uses without using SHFullScreen: http://www.codeproject.com/ce/fullscreen.asp