Full Screen Application

B

Bogdan Sima

Hello All,

I am trying to write an application which is supposed to work full screen. I
am using Windows CE .Net 4.2 and the compact framework.

Not being able to find any method of displaying the app full screen in the
compact framework, I tried to use the native API.

So, after I called FindWindow to get the handle of the taskbar window, then
ShowWindow to hide the taskbar and then BringWindowToTop to bring my
application's window to the top, the taskbar is still visible. Here's the
snippet:

int taskBarHWnd = FindWindow( "HHTaskBar", string.Empty );

ShowWindow( taskBarHWnd, SW_HIDE );

int myHWnd = GetForegroundWindow();

BringWindowToTop( myHWnd );

this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

Note: all the window handles returned by the native API functions are valid.

What am I doing wrong? Is there any method of creating a full screen app in
Windows CE .Net 4.2?

I also tried using the PocketPC extensions, without results.

I really believe/hope there is a way to create a full screen app in Win CE
..Net. After all, I don't think the user of an "alarm panel" type device
should have access to the taskbar.

Microsoft, please read: Not including a proper API to allow this behavior in
the .Net framework is a major design flaw. With all regrets, this is the
type of issue that can switch us to Embedded Linux.

Regards,

BG
 
B

Bogdan Sima

Thank you Girish, I have already tried that. The article is written for
PocketPC, and I am trying to do it on Win CE .Net 4.2 However, as I was
saying I've already tried it, and it cannot find the SHFullScreen function
in aygshell.dll.
 
P

Pete Vickers [eMVP]

Hi,
I use a function as follows

Declare Function SHFullScreen Lib "aygshell" ( _
ByVal hwndRequester As IntPtr, _
ByVal dwState As Integer) As Boolean


Public Function FullScreen(ByVal sHwnd As IntPtr, ByVal Full As Boolean) As
Boolean
Const SHFS_HIDESTARTICON = &H20
Const SHFS_SHOWSTARTICON = &H10
If Full Then
FullScreen = SHFullScreen(sHwnd, SHFS_HIDESTARTICON)
Else
FullScreen = SHFullScreen(sHwnd, SHFS_SHOWSTARTICON)
End If
End Function

Use it like....

Public Form_Handle as IntPtr

Me.Capture = True
Form_Handle = GetCapture
Me.Capture = False
FullScreen(Form_Handle, True)

HTH

Pete
 
B

Bogdan Sima

Thank you Pete. I am doing C#, so I declared like this:

[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();

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

public const int SHFS_HIDESTARTICON = 0x20;
public const int SHFS_SHOWSTARTICON = 0x10;

And in my form's Load method I called:

this.Capture = true;
IntPtr myHandle = GetCapture();
this.Capture = false;
SHFullScreen( myHandle, SHFS_HIDESTARTICON );

Still, the call to SHFullScreen raises a System.MissingMethodException.
 
B

Bogdan Sima

Pete, something more, I created a small VB app and added your code, and I am
getting the same exception in the CE Emulator. If I run in the PocketPC
emulator both the C# and VB versions of the code work.


Bogdan Sima said:
Thank you Pete. I am doing C#, so I declared like this:

[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();

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

public const int SHFS_HIDESTARTICON = 0x20;
public const int SHFS_SHOWSTARTICON = 0x10;

And in my form's Load method I called:

this.Capture = true;
IntPtr myHandle = GetCapture();
this.Capture = false;
SHFullScreen( myHandle, SHFS_HIDESTARTICON );

Still, the call to SHFullScreen raises a System.MissingMethodException.



Pete Vickers said:
Hi,
I use a function as follows

Declare Function SHFullScreen Lib "aygshell" ( _
ByVal hwndRequester As IntPtr, _
ByVal dwState As Integer) As Boolean


Public Function FullScreen(ByVal sHwnd As IntPtr, ByVal Full As
Boolean)
As
Boolean
Const SHFS_HIDESTARTICON = &H20
Const SHFS_SHOWSTARTICON = &H10
If Full Then
FullScreen = SHFullScreen(sHwnd, SHFS_HIDESTARTICON)
Else
FullScreen = SHFullScreen(sHwnd, SHFS_SHOWSTARTICON)
End If
End Function

Use it like....

Public Form_Handle as IntPtr

Me.Capture = True
Form_Handle = GetCapture
Me.Capture = False
FullScreen(Form_Handle, True)

HTH

Pete


--
Pete Vickers
Microsoft Windows Embedded MVP
HP Business Partner
http://www.gui-innovations.com
http://support.microsoft.com/defaul...port/kb/articles/Q266/2/44.ASP&NoWebContent=1 screen
in screen
app in
Win is
the
 
S

Steve Classing

Try setting the following:

form.WindowState = FormWindowState.Maximized;

For more information refer to the following article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfgaming.asp

Steve



Bogdan Sima said:
Pete, something more, I created a small VB app and added your code, and I am
getting the same exception in the CE Emulator. If I run in the PocketPC
emulator both the C# and VB versions of the code work.


Bogdan Sima said:
Thank you Pete. I am doing C#, so I declared like this:

[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();

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

public const int SHFS_HIDESTARTICON = 0x20;
public const int SHFS_SHOWSTARTICON = 0x10;

And in my form's Load method I called:

this.Capture = true;
IntPtr myHandle = GetCapture();
this.Capture = false;
SHFullScreen( myHandle, SHFS_HIDESTARTICON );

Still, the call to SHFullScreen raises a System.MissingMethodException.



Pete Vickers said:
Hi,
I use a function as follows

Declare Function SHFullScreen Lib "aygshell" ( _
ByVal hwndRequester As IntPtr, _
ByVal dwState As Integer) As Boolean


Public Function FullScreen(ByVal sHwnd As IntPtr, ByVal Full As
Boolean)
As
Boolean
Const SHFS_HIDESTARTICON = &H20
Const SHFS_SHOWSTARTICON = &H10
If Full Then
FullScreen = SHFullScreen(sHwnd, SHFS_HIDESTARTICON)
Else
FullScreen = SHFullScreen(sHwnd, SHFS_SHOWSTARTICON)
End If
End Function

Use it like....

Public Form_Handle as IntPtr

Me.Capture = True
Form_Handle = GetCapture
Me.Capture = False
FullScreen(Form_Handle, True)

HTH

Pete


--
Pete Vickers
Microsoft Windows Embedded MVP
HP Business Partner
http://www.gui-innovations.com

Thank you Girish, I have already tried that. The article is written for
PocketPC, and I am trying to do it on Win CE .Net 4.2 However, as I was
saying I've already tried it, and it cannot find the SHFullScreen function
in aygshell.dll.


Hi,

you can SHFullScreen() API call to create full screen applications

Check out this Microsoft Knowledge base article on how to create
full
screenhttp://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q266/2/44.ASP&NoWebContent=1
Hope this helps...

Girish.
Hello All,

I am trying to write an application which is supposed to work full
screen.
I
am using Windows CE .Net 4.2 and the compact framework.

Not being able to find any method of displaying the app full
screen
in
the
compact framework, I tried to use the native API.

So, after I called FindWindow to get the handle of the taskbar
window,
then
ShowWindow to hide the taskbar and then BringWindowToTop to bring my
application's window to the top, the taskbar is still visible.
Here's
the
snippet:

int taskBarHWnd = FindWindow( "HHTaskBar", string.Empty );

ShowWindow( taskBarHWnd, SW_HIDE );

int myHWnd = GetForegroundWindow();

BringWindowToTop( myHWnd );

this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

Note: all the window handles returned by the native API functions
are
valid.
What am I doing wrong? Is there any method of creating a full
screen
app
in
Windows CE .Net 4.2?

I also tried using the PocketPC extensions, without results.

I really believe/hope there is a way to create a full screen app
in
Win
CE
.Net. After all, I don't think the user of an "alarm panel" type device
should have access to the taskbar.

Microsoft, please read: Not including a proper API to allow this
behavior
in
the .Net framework is a major design flaw. With all regrets, this
is
the
type of issue that can switch us to Embedded Linux.

Regards,

BG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top