Is there a way to hide a program from another program using it's process handle?
Code:
#include <iostream>
#include <windows.h>
#include <cstdio>
#include <tlhelp32.h>
using namespace std;
int main()
{
PROCESSENTRY32 entry;
entry.dwSize = sizeof(PROCESSENTRY32);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (Process32First(snapshot, &entry) == TRUE)
{
while (Process32Next(snapshot, &entry) == TRUE)
{
if (strcmp(entry.szExeFile, "notepad.exe") == 0)
{
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID);
// Hide if program was found in the task manager
// ShowWindow(FindWindow(NULL, "asd"), SW_HIDE);
CloseHandle(hProcess);
}else{
// The program wasn't found
}
}
}
return 0;
}