Black Hole | Create pixel on the desktop and expand


#include <windows.h>

int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    HDC hDC = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
    POINT pCurPos;
    RECT rRect;
    HBRUSH hBrush = (HBRUSH)(CreateSolidBrush(RGB(0, 0, 0)));
    int iConst = 1;

    for( ; ; Sleep(1000))
    {
        if (GetAsyncKeyState(VK_ESCAPE) != 0)
            break;

        iConst += 3;
        GetCursorPos(&pCurPos);
        rRect.left = pCurPos.x - iConst;
        rRect.top = pCurPos.y - iConst;
        rRect.right = pCurPos.x + iConst;
        rRect.bottom = pCurPos.y + iConst;
        FillRect(hDC, &rRect, hBrush);
    }

    DeleteDC(hDC);
    return EXIT_SUCCESS;
}

I’m not sure where i got this a year ago but generally this code create a black pixel on your desktop. It will terminate only if you press ESCAPE which is detected by GetAsyncKeyState.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: