Full Screen features in Windows mobile

No.of Views1066
Bookmarked0 times
Downloads 
Votes0
By  RRaveen   On  15 Feb 2010 22:02:46
Tag : Windows Mobile , How to
Full Screen features in Windows mobile
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

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

 
Sign Up to vote for this article
 
About Author
 
RRaveen
Occupation-Software Engineer
Company-TGS
Member Type-Gold
Location-Singapore
Joined date-03 Jun 2009
Home Page-codegain.com
Blog Page-www.codegain.com
- B.Sc. degree in Computer Science. - 4+ years experience in Visual C#.net and VB.net - Obsessed in OOP style design and programming. - Designing and developing Network security tools. - Designing and developing a client/server application for sharing files among users in a way other than FTP protocol. - Designing and implementing GSM gateway applications and bulk messaging. - Windows Mobile and Symbian Programming - Having knowledge with ERP solutions
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top