Reputation: 702
I'm working with VB.Net on a Windows CE mobile device. I'm trying to show my forms at "full screen" (that is, covering the entire screen, even on top of the task bar) while not allowing the form to be moved/dragged. So far, I've only achieve either:
Having the form at full screen, but the user can drag it. I did this by simply setting the form's height and width to that of the screen.
Disabling the dragging (by setting the windowstate to "maximized"), but the taskbar is visible and enabled
Disabling the dragging (again using Maximized), hiding the taskbar (by using ShowWindow from the coredll), but the window is cut off at the bottom-- the area where the taskbar is supposed to be, where it now shows a blank area instead of the rest of the form like I wanted
I've tried SetWindowPos, but the taskbar is still there. Code below:
' this code is from the main form's load event
CDevice.HideTaskBar(Me)
Me.AutoScroll = False
Me.WindowState = FormWindowState.Maximized
And here is the definition for HideTaskBar (from the code above):
Public Const SWP_NOSIZE As Int32 = &H1
Public Const SWP_NOMOVE As Int32 = &H2
Public Shared Sub HideTaskBar(ByRef obj As Form)
Dim taskhWin = FindWindow("HHTaskBar", Nothing)
SetWindowPos(taskhWin, New IntPtr(-1), 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
SetWindowPos(obj.Handle, New IntPtr(1), 0, 0, 240, 320, 0)
End Sub
Upvotes: 0
Views: 5383
Reputation: 5959
Although WindowsCE (what version do you have?) behaves a bit different, take a look here: http://www.hjgode.de/wp/2012/05/10/windows-mobile-kiosk-mode-series-part-1/ Although I coded in C# you should be able to translate it to VB. See code here: http://code.google.com/p/weh653kiosmodes/source/browse/trunk/OEMTitleBarHandler/OEMTitleBarHandler/FullScreen.cs
First hide the taskbar
Use a form without caption bar (no title bar)
Query the systems screen dimensions
Resize and move the form to fill the screen dimensions or try Form.WindowState=Maximized.
Upvotes: 1