PhotoShaman

Шутки с курсором(Выход - Esc)

Dec 10th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <clocale>
  3. #include <cmath>
  4. #include <windows.h>
  5.  
  6. #pragma hdrstop
  7.  
  8. using namespace std;
  9.  
  10. void main()
  11. {
  12.     HWND TaskMgr;
  13.  
  14.     while (true) {
  15.         ShowWindow(GetConsoleWindow(), SW_HIDE);
  16.         TaskMgr = FindWindow(NULL, L"Диспетчер задач Windows"); // :)
  17.         if (TaskMgr != NULL)
  18.             PostMessage(TaskMgr, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  19.         int x = 100, y = 100;
  20.         for (; x < 200; x++)
  21.             SetCursorPos(x, y);
  22.         for (; y < 200; y++)
  23.             SetCursorPos(x, y);
  24.         for (; x > 100; x--)
  25.             SetCursorPos(x, y);
  26.         for (; y > 100; y--)
  27.             SetCursorPos(x, y);
  28.         ShowWindow(GetConsoleWindow(), SW_SHOW);
  29.         if (GetAsyncKeyState(VK_ESCAPE))
  30.             exit(1);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment