why does this code not work on Win Ce.net embedded

P

Peter

Hello All,

I tried to hide the win taskbar with no avail...

Is there something wrong in the code ??

Thanks

Peter



Imports System.Runtime.InteropServices

Public Class Form1

Inherits System.Windows.Forms.Form

#Region "Test"

Const SHFS_SHOWTASKBAR As Integer = &H1

Const SHFS_HIDETASKBAR As Integer = &H2

Const SHFS_SHOWSIPBUTTON As Integer = &H4

Const SHFS_HIDESIPBUTTON As Integer = &H8

Const SHFS_SHOWSTARTICON As Integer = &H10

Const SHFS_HIDESTARTICON As Integer = &H20







<DllImport("aygshell.dll")> _

Shared Function SHFullScreen(ByVal hwndRequester As IntPtr, ByVal dwState As
Integer) As Integer

End Function

<DllImport("coredll.dll")> _

Public Shared Function GetCapture() As IntPtr

End Function

#End Region



#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

MyBase.Dispose(disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents Button1 As System.Windows.Forms.Button

Private Sub InitializeComponent()

Me.Button1 = New System.Windows.Forms.Button

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(68, 74)

Me.Button1.Size = New System.Drawing.Size(72, 30)

Me.Button1.Text = "Close"

Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable

'

'Form1

'

Me.ClientSize = New System.Drawing.Size(204, 135)

Me.Controls.Add(Me.Button1)

Me.Text = "Form1"

Me.WindowState = System.Windows.Forms.FormWindowState.Maximized

End Sub

Public Shared Sub Main()

Application.Run(New Form1)

End Sub

#End Region

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Capture = True

Dim hwnd As IntPtr = GetCapture()

Capture = False

Try

SHFullScreen(hwnd, SHFS_HIDETASKBAR )

Catch

End Try

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Close()

End Sub

End Class
 
C

Chris Tacke, eMVP

These are Pocket PC (aygshell to be specific) APIs. They shouldn't work on
a vanilla CE device.
 
P

Peter

Thanks Chris !!

Maybe you or somebody else can help me out how to get this working on the
CE.NET embedded device ? (not showing the win taskbar, because the user is
only allowed to use one program)

Any ideas are welcome !

Peter
 
P

Peter

Thanks again Chris,

What I found didn't work on the emulator ?
I'm a newbie in so please bear with me.......

the hWnd returns 735584 so I guess the taskbar is found,
but I don't understand what the IntPtr.Zero does.

Must I do something extra ?

Peter.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim hWnd As IntPtr = FindWindow("HHTaskbar", Nothing)

hWnd = IntPtr.Zero

End Sub

<DllImport("coredll")> _

Public Shared Function FindWindow(ByVal lpClass As String, ByVal lpTitle As
String) As IntPtr

End Function
 

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