With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.
If you need to hide the Start Icon and/or the SIP (soft input panel, software keyboard button), you normally use the MS Mobile SDK SHFullscreen API. But this will not work for Windows Embedded Handheld!
So, to workaround this, you can change the registry and make the OS think, it has a hardware key for the start icon. There are three possible entries inside HKLM responsible for the design of the menu bar at SOFTWARE\Microsoft\Shell\B
TextModeEnable controls the way the menu bar is drawn. O is for normal, graphic draw of the menu bar and 1 is used to define a text based draw of the menu bar.
HardwareStartKeyEnabled controls the display of the Start Icon.
HardwareDoneKeyEnabled controls the display of the (OK) button inside the menu bar.
Now you can change HardwareStartKeyEnabled to 1 and the OS will think, the device has a hardware start button and does no more display an icon on the left of the menu bar. After you changed the registry key, all new windows will show without the start icon. Or, when you reboot, the start icon will not more being visible for any window or application.
SHFullscreen has no function in WEH
As SHFullscreen does not work for SHFS_HIDESTARTICON for WEH, you can use this registry key to hide the start icon in your application. Attached is a Compact Framework class called LockDown (namespsace LockDown) you can use to save the current state of the above registry keys and change and restore the keys.
You can use the class before your first form is displayed. The first form is normally launched from your project's program.cs code file:
static void Main...
Lockdown.LockDown.SetRegistryFullScreen(false, true, false);
The static function LockDown.SetRegistryFullSc
reen needs three boolean arguments. The first enables or disables the display of the Start Icon, the second does the same for the Done/OK button in the menu bar and the last controls the TextMode display of the menu bar. So it is very easy to hide or show the start icon for a new form.
The SIP (software keyboard button)
Another argument you can use with SHFullscreen, that does not work any more with Windows Embedded Handheld is SHFS_HIDESIPBUTTON. The SHFullscreen function just returns OK, but the SIP button will still be visible in the menu bar.
To work around this, we can use the Miccrosoft Windows Mobile SDK functions FindWindow and ShowWindow:
[DllImportAttribute("coredll.dll", EntryPoint = "FindWindow", SetLastError = true, PreserveSig = true, CallingConvention = CallingConvention.Winapi)]
private static extern IntPtr FindWindow(string className, string wndName);
[DllImportAttribute("coredll.dll", EntryPoint = "ShowWindow", SetLastError = false, PreserveSig = true, CallingConvention = CallingConvention.Winapi)]
public static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
public static void ShowKeyboardSIP(bool bShow)
IntPtr intPtr1 = FindWindow("MS_SIPBUTTON", "MS_SIPBUTTON");
if (intPtr1 == IntPtr.Zero)
IntPtr intPtr2 = GetWindow(intPtr1, (uint)GetWindowFlags.GW_CHILD);
if (intPtr2 != IntPtr.Zero)
bool b1 = ShowWindow(intPtr2, (bShow ? (int)(ShowWindowFlags.SW_SHOWNORMAL | ShowWindowFlags.SW_SHOWNOACTIVATE) : 0 ));// 5 : 0));
bool b2 = ShowWindow(intPtr1, (bShow ? (int)(ShowWindowFlags.SW_SHOWNORMAL | ShowWindowFlags.SW_SHOWNOACTIVATE) : 0));// 5 : 0));5 : 0));
This compact framework code finds the parent window of the SIP button and then the button (which is also a window, like every element). Then it hides or shows the window (button).
This is very easy to use in a compact framework application, just call ShowKeyboardSIP(bShow); where you need to hide or show the SIP.
The third possible argument you can use with SHFullscreen is SHFS_HIDETASKBAR. Within Visual Studio (2003/2005/2008) you just have to set the Forms WindowState property to Maximized to hide the taskbar. All forms with maximized windowstate will show without taskbar.
The attached class file contains some more functions you can play with. It also can use SHFullscreen, so you can test the functionality on Windows Mobile (6.1) and Windows Embedded Handheld (6.5.3). You can try the code without restrictions also in the available windows mobile emulators.
Have fun coding
[a demo using the class is available at code.google.com/p/weh653ki