SHFullScreen (aygshell)
Last changed: davidsonblake86@gmail.com-72.202.204.193

.
Summary
SHFullScreen is a simple boolean function for hiding or displaying CE and PocketPC desktop elements such as the TaskBar, the Start Icon and the SIP (Standard Input Panel).

C# Signature:

  [DllImport("aygshell.dll")]
  static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);

VB Signature:

  <DllImport("aygshell.dll", SetLastError:=True)> _
  Public Shared Function SHFullScreen( hWnd as IntPtr, flags as Integer ) as Integer
  End Function

User-Defined Types:

C# Constants:

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;

VB Constants:

Const SHFS_SHOWTASKBAR As UInteger = &H1

Const SHFS_HIDETASKBAR As UInteger = &H2

Const SHFS_SHOWSIPBUTTON As UInteger = &H4

Const SHFS_HIDESIPBUTTON As UInteger = &H8

Const SHFS_SHOWSTARTICON As UInteger = &H10

Const SHFS_HIDESTARTICON As UInteger = &H20

Notes:

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.

Tips & Tricks:

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.

Update. Microsoft's SHFullScreen definition at http://msdn.microsoft.com/en-us/library/aa453694.aspx states that SHFS_SHOWTASKBAR and SHFS_HIDETASKBAR can be used with Windows CE, but remaining State flags pertaining to the SIP and Start Icons are only relevant in Pocket PC.

Sample Code:

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);

}

Alternative Managed API:

Functions for doing the same uses without using SHFullScreen: http://www.codeproject.com/ce/fullscreen.asp

Documentation

Alternate Method for making Full Screen application without using DLL's

Set your form's FormBorderStyle to None ,set WindowState to Normal and TopMost to True

and add the following in your form initialization

        this.Height = Screen.PrimaryScreen.Bounds.Height;
        this.Width = Screen.PrimaryScreen.Bounds.Width;