Skip to content

Instantly share code, notes, and snippets.

@JubbaSmail
Created November 13, 2014 09:39
Show Gist options
  • Save JubbaSmail/8aab80ce7f2e8c7d1618 to your computer and use it in GitHub Desktop.
Save JubbaSmail/8aab80ce7f2e8c7d1618 to your computer and use it in GitHub Desktop.
#include <windows.h>
#if define UNICODE
#define FindWindow FindWindowW
#define SendMessage SendMessageW
#else
#define FindWindow FindWindowA
#define SendMessage SendMessageA
#endif
void EndTaskMang()
{
while (TRUE)
{
HANDLE TaskMgr = FindWindow(NULL, "Task Manager");//Calculator
if (TaskMgr != INVALID_HANDLE_VALUE)
SendMessage(TaskMgr, WM_SYSCOMMAND, SC_CLOSE, FALSE);
Sleep(100);
}
}
int main(int argc, LPTSTR argv[])
{
KillTaskMang();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment