Detect Hide


SUBMITTED BY: Guest

DATE: July 28, 2013, 10:15 p.m.

FORMAT: C++

SIZE: 1.3 kB

HITS: 891

  1. #include "stdafx.h"
  2. #include <conio.h>
  3. extern "C" BOOL __stdcall EndTask(HWND,BOOL,BOOL);
  4. #define WINNT 1
  5. struct ProcInfo {
  6. HWND hWnd;
  7. DWORD dwProcId;
  8. CHAR szTitle[255];
  9. CHAR szClass[255];
  10. };
  11. void DetectHideToolz()
  12. {
  13. DWORD dwProcId;
  14. HWND hWnd;
  15. ProcInfo mProc[255];
  16. int mIdList[255];
  17. int nCount = 0;
  18. int nPID = 0;
  19. int i = 0;
  20. hWnd = FindWindow(0,0);
  21. while( hWnd > 0)
  22. {
  23. if (GetParent(hWnd) == 0)
  24. {
  25. GetWindowThreadProcessId(hWnd, &dwProcId);
  26. if (!OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcId))
  27. {
  28. mProc[nCount].hWnd = hWnd;
  29. mProc[nCount].dwProcId = dwProcId ;
  30. GetWindowTextA(hWnd, mProc[nCount].szTitle, 255);
  31. GetClassNameA(hWnd, mProc[nCount].szClass, 255);
  32. nCount++;
  33. for (i = 0; i < nPID; i++)
  34. if (dwProcId == mIdList[i])
  35. break;
  36. if (i == nPID)
  37. mIdList[nPID++] = dwProcId;
  38. }
  39. }
  40. hWnd = GetWindow(hWnd, GW_HWNDNEXT);
  41. }
  42. if (nCount > 0)
  43. {
  44. for (i = 0; i < nCount; i++)
  45. {
  46. if (IsWindow(mProc[i].hWnd))
  47. {
  48. SendMessageA(mProc[i].hWnd, WM_CLOSE, 0, 0);
  49. SendMessageA(mProc[i].hWnd, WM_QUIT, 0, 0);
  50. SendMessageA(mProc[i].hWnd, WM_DESTROY, 0, 0);
  51. EndTask(mProc[i].hWnd, FALSE, TRUE);
  52. }
  53. }
  54. }
  55. }

comments powered by Disqus