Hide your VB.NET Application

Posts 13 of 3 · Page 1 of 1
Hide your VB.NET Application
Hey guys,

This tutorial will make your VB.NET Application completely hidden (except in the Task Manager).

First just go into code view of the form you want to hide. Place the following code into your form below Public Class Form1

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

'Hides the application        
Me.Opacity = 0
        Me.ShowInTaskbar = False
        Me.Hide()
        Me.WindowState = FormWindowState.Minimized

        'Calls the function to hide the application from the taskbar

        Call SetWindowPos(TaskBarHwnd, 0&, 0&, 0&, 0&, 0&, SWP_HIDEWINDOW)
        TaskBarHwnd = FindWindow("Shell_traywnd", "")


    End Sub

    'Hides application from taskbar

    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Const SWP_HIDEWINDOW = &H80
    Const SWP_SHOWWINDOW = &H40
    Dim TaskBarHwnd As Long
Final Result:
I like how there's an error in the screenshot you provided lolz.
End Sub == Doing nothing in there..

And there are easier ways to do this
Posts 13 of 3 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?