WIth some research I was able to come out with the simplest way to do it.
here are the declarations:
Code:
Public Class frmInitial
Declare Function FindWindow Lib "coredll.dll" (ByVal className As String, ByVal windowName As String) As Integer
Declare Function ShowWindow Lib "coredll.dll" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
Declare Function EnableWindow Lib "coredll.dll" (ByVal hwnd As Integer, ByVal bEnable As Boolean) As Integer
this code on form load to hide and disable the taskbar
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hWnd As Integer
hWnd = FindWindow("HHTaskBar".ToCharArray(), Nothing)
EnableWindow(hWnd, False)
ShowWindow(hWnd, 0)
End Sub
this code on your application.close button or whatever way you are doing it, to show and enable the taskbar upon exit
Code:
Dim hWnd As Integer
hWnd = FindWindow("HHTaskBar".ToCharArray(), Nothing)
EnableWindow(hWnd, True)
ShowWindow(hWnd, 1)
con.Close()
Application.Exit()