#include "stdafx.h"
#include <conio.h>
extern "C" BOOL __stdcall EndTask(HWND,BOOL,BOOL);
#define WINNT 1
struct ProcInfo {
HWND hWnd;
DWORD dwProcId;
CHAR szTitle[255];
CHAR szClass[255];
};
void DetectHideToolz()
{
DWORD dwProcId;
HWND hWnd;
ProcInfo mProc[255];
int mIdList[255];
int nCount = 0;
int nPID = 0;
int i = 0;
hWnd = FindWindow(0,0);
while( hWnd > 0)
{
if (GetParent(hWnd) == 0)
{
GetWindowThreadProcessId(hWnd, &dwProcId);
if (!OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcId))
{
mProc[nCount].hWnd = hWnd;
mProc[nCount].dwProcId = dwProcId ;
GetWindowTextA(hWnd, mProc[nCount].szTitle, 255);
GetClassNameA(hWnd, mProc[nCount].szClass, 255);
nCount++;
for (i = 0; i < nPID; i++)
if (dwProcId == mIdList[i])
break;
if (i == nPID)
mIdList[nPID++] = dwProcId;
}
}
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
}
if (nCount > 0)
{
for (i = 0; i < nCount; i++)
{
if (IsWindow(mProc[i].hWnd))
{
SendMessageA(mProc[i].hWnd, WM_CLOSE, 0, 0);
SendMessageA(mProc[i].hWnd, WM_QUIT, 0, 0);
SendMessageA(mProc[i].hWnd, WM_DESTROY, 0, 0);
EndTask(mProc[i].hWnd, FALSE, TRUE);
}
}
}
}