all groups > dotnet compact framework > november 2006 >
You're in the

dotnet compact framework

group:

Fullscreen ?


Fullscreen ? Engin AYDOGAN
11/29/2006 12:00:00 AM
dotnet compact framework:
I want to make my application to use the whole screen, searched through
msdn and it suggests to use `WindowState = FormWindowState.Maximized;'
in the (only) Form of the program, but it doesn't work. I still can see
the taskbar and title bar. I've tried placing above statment to few
places (i.e. in c-tor/onLoad of the form, etc), still no go.

Re: Fullscreen ? Engin AYDOGAN
11/29/2006 12:00:00 AM
Thanks but that seems totally platform dependent. And I believe there
should be a neat and simple way of doing this.

[quoted text, click to view]
Re: Fullscreen ? Tore Stensby
11/29/2006 12:00:00 AM
[quoted text, click to view]

In my app, I use this on one of my forms:
Private Sub frmSkjermLock_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.WindowState = FormWindowState.Maximized
End Sub

And i have set the property FormBorderStyle to None in the designer.



ToreS



Re: Fullscreen ? Buthrakaur
11/29/2006 12:54:47 AM
Hi, it's possible to create a fullscreen app using SHFullScreen
function from aygshell.dll. Take a look on following code snippet:



public static bool SetTaskBarEnabled(bool enabled)
{
IntPtr hwnd = Win32Window.FindWindow("HHTaskBar", null);
return Win32Window.EnableWindow(hwnd, enabled);
}

[DllImport("aygshell.dll", EntryPoint="SHFullScreen",
SetLastError=true)]
private static extern bool SHFullScreen(IntPtr apphwnd, int state);


const int SHFS_SHOWTASKBAR = 0x1;
const int SHFS_HIDETASKBAR = 0x2;
const int SHFS_SHOWSIPBUTTON = 0x4;
const int SHFS_HIDESIPBUTTON = 0x8;
const int SHFS_SHOWSTARTICON = 0x10;
const int SHFS_HIDESTARTICON = 0x20;
const int SWP_NOZORDER = 0x4;
private const int HHTASKBARHEIGHT = 26;
/* private const int SHFS_HIDETASKBAR = &H2;
private const int SWP_NOZORDER = &H4;*/

public static bool HideTaskBarForWindow(IntPtr hwnd)
{
Rectangle rect = Win32Window.GetWindowRect(hwnd);
int width = rect.Right - rect.Left;
int height = rect.Bottom - rect.Top;
SHFullScreen(hwnd, SHFS_HIDETASKBAR);
Win32Window.SetWindowPos(hwnd, OpenNETCF.Win32.HWND.TOPMOST, 0,
0, width, height + HHTASKBARHEIGHT, SWP.NOZORDER);
return true;
}

public static bool SetStartButtonVisible(bool visible, IntPtr hwnd)
{
if (hwnd.ToInt32() > 0)
{
return SHFullScreen(hwnd, visible ? SHFS_SHOWSTARTICON :
SHFS_HIDESTARTICON);
}
else
{
return false;
}
}

public static bool ShowTaskBarForWindow(IntPtr hwnd)
{
Rectangle rect = Win32Window.GetWindowRect(hwnd);
int width = rect.Right - rect.Left;
int height = rect.Bottom - rect.Top;
SHFullScreen(hwnd, SHFS_SHOWTASKBAR);
Win32Window.SetWindowPos(hwnd, OpenNETCF.Win32.HWND.TOPMOST, 0,
HHTASKBARHEIGHT, width, height - HHTASKBARHEIGHT, SWP.NOZORDER);
return true;
}



Engin AYDOGAN napsal:
[quoted text, click to view]
Re: Fullscreen ? Buthrakaur
11/29/2006 7:08:56 AM
I see, I silently presumed you're talking about PPC platform, but
you're targetting WinCE if I understand it right. My previous snippet
is designed for PPC. If I remember right, I had to P/Invoke
SetWindowPos to fill the whole screen with my window on WinCE device.

Rectangle scrrect = Screen.PrimaryScreen.Bounds;
Win32Window.SetWindowPos(win, HWND.TOPMOST, 0, 0, scrrect.Width,
scrrect.Height, SWP.NOZORDER);



Engin AYDOGAN napsal:
[quoted text, click to view]
Re: Fullscreen ? Engin AYDOGAN
11/29/2006 1:37:30 PM
[quoted text, click to view]
I'm doing the same. But when I deploy (into Win CE 5.0) and start my
application, it starts like a usual app with title bar and taskbar is
visible.

I create the form and pass it to the event loop.

Application.Run(new Form1());

And

private void Form1_Load(object sender, EventArgs e)
{
System.Console.Write( "load\n" );
MinimizeBox = false;
MaximizeBox = false;
////////////////////////////////////////
WindowState = FormWindowState.Maximized;
}

Re: Fullscreen ? vikash
11/29/2006 9:42:23 PM
please remove any instance of MainMenu from the designer, hope it will
work.


thanks n regards
vikash


[quoted text, click to view]
AddThis Social Bookmark Button