Skip to content

Instantly share code, notes, and snippets.

@MARSHMALLLOW
Created September 29, 2019 19:12
Show Gist options
  • Save MARSHMALLLOW/f0de196b60d62b9fd658503a250471bf to your computer and use it in GitHub Desktop.
Save MARSHMALLLOW/f0de196b60d62b9fd658503a250471bf to your computer and use it in GitHub Desktop.
#include <Windows.h>
int main() {
int inc;
int sw = GetSystemMetrics(SM_CXSCREEN);
int sh = GetSystemMetrics(SM_CYSCREEN);
while(1)
{
inc++;
int x = rand() % (sw - 0);
int w = rand() % (5 - 0);
int y = inc;
HDC hdc = GetDC(HWND_DESKTOP);
BitBlt(hdc, x, y, w, sw, hdc, x, 0, SRCCOPY);
Sleep(100);
}
}
@pankoza2-pl
Copy link

For some reason it only works if compiled as 64-bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment