using System
using System.Runtime.InteropServices
using System.Windows.Forms
using System.Text
namespace TestApp
/// <summary
/// Provides an interface to hide and show the SIP, SIP button, and the Start button
/// </summary
public class SHFullScreenHelpe
private const Int32 SHFS_SHOWSIPBUTTON = 0x0004
private const Int32 SHFS_HIDESIPBUTTON = 0x0008
private const Int32 SHFS_SHOWSTARTICON = 0x0010
private const Int32 SHFS_HIDESTARTICON = 0x0020
#define SHFS_SHOWTASKBAR 0x0001
#define SHFS_HIDETASKBAR 0x0002
#define SHFS_SHOWSIPBUTTON 0x0004
#define SHFS_HIDESIPBUTTON 0x0008
#define SHFS_SHOWSTARTICON 0x0010
#define SHFS_HIDESTARTICON 0x0020
private const string formWindowClassName = "#NETCF_AGL_BASE_"
[DllImport("aygshell.dll")]
private static extern Int32 SHFullScreen(IntPtr hWnd, Int32 dwState)
[DllImport("coredll.dll")]
private static extern IntPtr FindWindow(string className, string windowName)
[DllImport("coredll.dll")]
private static extern Int32 GetClassName(IntPtr hWnd, StringBuilder className, int maxCount)
public static bool ShowStartIcon(Form f, bool bShow)
Int32 dwFlag = bShow ? SHFS_SHOWSTARTICON : SHFS_HIDESTARTICON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0
public static bool ShowSIPButton(Form f, bool bShow)
Int32 dwFlag = bShow ? SHFS_SHOWSIPBUTTON : SHFS_HIDESIPBUTTON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0
private static IntPtr GetWindowHandle(Form f)
return FindWindow(formWindowClassName, f.Text)
}
To use it, just create a class file and drop in the code. Then, call the function as follows
SHFullScreenHelper.ShowSIPButton(this, false); //This hides the SIP button (C#
SHFullScreenHelper.ShowSIPButton(this, true); //This displays the SIP button (C#
SHFullScreenHelper.ShowSIPButton(Me, False) 'This hides the SIP button (VB
SHFullScreenHelper.ShowSIPButton(Me, True) 'This shows the SIP button (VB
You can also show and hide the Start menu button as follows
SHFullScreenHelper.ShowStartButton(this, false); //This hides the Start butto
SHFullScreenHelper.ShowStartButton(this, true); //This shows the Start butto
SHFullScreenHelper.ShowStartButton(Me, False) 'This hides the Start button (VB
SHFullScreenHelper.ShowStartButton(Me, True) 'This shows the Start button (VB
using System.Runtime.InteropServices
using System.Windows.Forms
using System.Text
namespace TestApp
/// <summary
/// Provides an interface to hide and show the SIP, SIP button, and the Start button
/// </summary
public class SHFullScreenHelpe
private const Int32 SHFS_SHOWSIPBUTTON = 0x0004
private const Int32 SHFS_HIDESIPBUTTON = 0x0008
private const Int32 SHFS_SHOWSTARTICON = 0x0010
private const Int32 SHFS_HIDESTARTICON = 0x0020
#define SHFS_SHOWTASKBAR 0x0001
#define SHFS_HIDETASKBAR 0x0002
#define SHFS_SHOWSIPBUTTON 0x0004
#define SHFS_HIDESIPBUTTON 0x0008
#define SHFS_SHOWSTARTICON 0x0010
#define SHFS_HIDESTARTICON 0x0020
private const string formWindowClassName = "#NETCF_AGL_BASE_"
[DllImport("aygshell.dll")]
private static extern Int32 SHFullScreen(IntPtr hWnd, Int32 dwState)
[DllImport("coredll.dll")]
private static extern IntPtr FindWindow(string className, string windowName)
[DllImport("coredll.dll")]
private static extern Int32 GetClassName(IntPtr hWnd, StringBuilder className, int maxCount)
public static bool ShowStartIcon(Form f, bool bShow)
Int32 dwFlag = bShow ? SHFS_SHOWSTARTICON : SHFS_HIDESTARTICON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0
public static bool ShowSIPButton(Form f, bool bShow)
Int32 dwFlag = bShow ? SHFS_SHOWSIPBUTTON : SHFS_HIDESIPBUTTON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0
private static IntPtr GetWindowHandle(Form f)
return FindWindow(formWindowClassName, f.Text)
}
To use it, just create a class file and drop in the code. Then, call the function as follows
SHFullScreenHelper.ShowSIPButton(this, false); //This hides the SIP button (C#
SHFullScreenHelper.ShowSIPButton(this, true); //This displays the SIP button (C#
SHFullScreenHelper.ShowSIPButton(Me, False) 'This hides the SIP button (VB
SHFullScreenHelper.ShowSIPButton(Me, True) 'This shows the SIP button (VB
You can also show and hide the Start menu button as follows
SHFullScreenHelper.ShowStartButton(this, false); //This hides the Start butto
SHFullScreenHelper.ShowStartButton(this, true); //This shows the Start butto
SHFullScreenHelper.ShowStartButton(Me, False) 'This hides the Start button (VB
SHFullScreenHelper.ShowStartButton(Me, True) 'This shows the Start button (VB