Introduction I was looking msdn forums last few days, there many guys asked about the full screen features in windows mobile. Therefore I will post here my code for that.
The full screen features we can do by two ways. 1. We can do simplify in Windows mobile 5.0 or later like hide the menu, give empty text and set windows state is maximized. 2. We can do by the calling P/Invoke. It’s little interesting, because of OS API have a interesting method "SHFullScreen"
So when we pass our current form handle and window states to this method it's done.
Before that we must get window handle for current window.
so sample code below {codecitation class="brush: c#; gutter: true;" width="600px"} public class WinAPI { internal const int SHFS_SHOWTASKBAR = 0x0001; internal const int SHFS_HIDETASKBAR = 0x0002; internal const int SHFS_SHOWSIPBUTTON = 0x0004; internal const int SHFS_HIDESIPBUTTON = 0x0008; internal const int SHFS_SHOWSTARTICON = 0x0010; internal const int SHFS_HIDESTARTICON = 0x0020; // Code used to hide the Windows bar [DllImport("aygshell.dll", EntryPoint = "SHFullScreen", SetLastError = true)] internal static extern bool SHFullScreen(IntPtr hwndRequester, int dwState); [DllImport("coredll.dll", EntryPoint = "GetForegroundWindow", SetLastError = true)] internal static extern IntPtr GetForegroundWindow(); [DllImport("coredll.dll")] public static extern IntPtr GetCapture(); // Code used to hide the Windows bar public static void FullScreen() { IntPtr hwnd = GetForegroundWindow(); SHFullScreen(hwnd, SHFS_HIDETASKBAR); } } {/codecitation} Yes that's all. Thank you RRaveen |