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
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