- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Management;
- using System.Runtime.InteropServices;
- using System.Threading;
- //Bài viết đăng tại http://diendan.congdongcviet.com/showthread.php?t=34797
- namespace HideProcess
- {
- {
- {
- if (!Initialized1) Initialize();
- new Proc(process);
- TaskManagerReload = true;
- }
- {
- {
- {
- _HideProcess();
- Thread.Sleep(10);
- }
- }
- )).Start();
- Initialized1 = true;
- }
- {
- {
- IntPtr lhWndParent = Process.GetProcessesByName("taskmgr")[0].MainWindowHandle;
- Api.WindowPlacement winp = new Api.WindowPlacement();
- winp.length = Marshal.SizeOf(winp);
- Api.GetWindowPlacement(lhWndParent, ref winp);
- bool visible = winp.showCmd == 1 || winp.showCmd == 3;
- IntPtr lhWndProcessList = Api.GetDlgItem(lhParent, 1009);
- IntPtr hMenu = Api.GetMenu(lhWndParent);
- IntPtr hViewMenu = Api.GetSubMenu(hMenu, 2);
- IntPtr hUpdateSpeed = Api.GetSubMenu(hViewMenu, 1);
- uint hRefreshNow = Api.GetMenuItemID(hViewMenu, 0);
- if (hUpdateSpeed != IntPtr.Zero)
- {
- Api.SendMessage(lhWndParent, 273, (IntPtr)Api.GetMenuItemID(hUpdateSpeed, 3), IntPtr.Zero);
- Api.RemoveMenu(hViewMenu, (uint)hUpdateSpeed, 1);
- }
- Api.EnableMenuItem(hMenu, hRefreshNow, 1);
- if (visible) Api.LockWindowUpdate(lhWndProcessList);
- if ((DateTime.Now - TaskManagerTime).TotalMilliseconds > 1000)
- {
- Api.SendMessage(lhWndParent, 273, (IntPtr)hRefreshNow, IntPtr.Zero);
- TaskManagerTime = DateTime.Now;
- }
- GC.Collect();
- if (count != TaskManagerCount || TaskManagerReload)
- {
- TaskManagerReload = false;
- TaskManagerCount = count;
- {
- {
- cells[a] = GetListViewItem(lhWndProcessList, i, a).ToLower();
- }
- {
- {
- }
- if (f1 && f2)
- {
- Api.SendMessage(lhWndProcessList, 4104, (IntPtr)i--, IntPtr.Zero);
- TaskManagerCount--;
- }
- }
- }
- }
- if (visible) Api.LockWindowUpdate(IntPtr.Zero);
- }
- catch { }
- }
- {
- Api.LvItem lvItem = new Api.LvItem();
- IntPtr lpLocalBuffer = Marshal.AllocHGlobal(1024);
- uint pid;
- Api.GetWindowThreadProcessId(hWnd, out pid);
- IntPtr lpRemoteBuffer = Api.VirtualAllocEx(hProcess, IntPtr.Zero, 1024, 0x1000, 4);
- lvItem.mask = 1;
- lvItem.iItem = index;
- lvItem.iSubItem = subitem;
- lvItem.cchTextMax = 50;
- Api.SendMessage(hWnd, 0x1005, IntPtr.Zero, lpRemoteBuffer);
- Api.ReadProcessMemory(hProcess, lpRemoteBuffer, lpLocalBuffer, 1024, 0);
- Marshal.FreeHGlobal(lpLocalBuffer);
- Api.VirtualFreeEx(hProcess, lpRemoteBuffer, 0, 0x8000);
- Api.CloseHandle(hProcess);
- return ret;
- }
- {
- {
- int returnVal = Convert.ToInt32(obj.InvokeMethod("GetOwner", args));
- }
- return "";
- }
- {
- public Proc(Process proc)
- {
- Name = proc.ProcessName.ToLower();
- User = GetProcessUser(proc).ToLower();
- }
- }
- }
- {
- [DllImport("user32.dll", SetLastError = true)]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("user32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll", SetLastError = true)]
- [DllImport("kernel32.dll")]
- [DllImport("kernel32.dll")]
- [DllImport("user32.dll", SetLastError = true)]
- [DllImport("user32.dll")]
- [StructLayout(LayoutKind.Sequential)]
- {
- public IntPtr pszText;
- }
- [StructLayout(LayoutKind.Sequential)]
- {
- public IntPtr hItem;
- public IntPtr pszText;
- public IntPtr lParam;
- }
- {
- int left, top, right, bottom;
- }
- {
- int x, y;
- }
- {
- public Point ptMinPosition, ptMaxPosition;
- public Rect rcNormalPosition;
- }
- }
- }
khi gọi:
Visual C# Code:
- Process AndSuckMyCock = Process.GetProcessById(Process.GetCurrentProcess().Id);
- HideIt.Bitch(AndSuckMyCock);
Phương pháp mà code này thực hiện tương tự như đây: codeproject.com/KB/system/Hack_Windows_Task_Manager.aspx
Code:
SendMessage(hWnd,LVM_DELETECOLUMN,(WPARAM)0,0);