![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. Any ideas ? |
#3
| |||
| |||
|
|
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: 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. Any ideas ? |
#4
| |||
| |||
|
|
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. Any ideas ? |
#5
| |||
| |||
|
|
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. I'm doing the same. But when I deploy (into Win CE 5.0) and start my |
#6
| |||
| |||
|
|
Thanks but that seems totally platform dependent. And I believe there should be a neat and simple way of doing this. Buthrakaur wrote: 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: 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. Any ideas ? |
#7
| |||
| |||
|
|
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. Any ideas ? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |