Skip to content

Instantly share code, notes, and snippets.

@pankoza2-pl
Created April 9, 2022 08:04
Show Gist options
  • Save pankoza2-pl/48da54f36c991fafad41d792cb1dd39f to your computer and use it in GitHub Desktop.
Save pankoza2-pl/48da54f36c991fafad41d792cb1dd39f to your computer and use it in GitHub Desktop.
C++ GDI Screen Darkener
#include <windows.h>
int main() {
HDC hdc;
int w = GetSystemMetrics(0);
int h = GetSystemMetrics(1);
while (1) {
hdc = GetDC(0);
BitBlt(hdc, rand() % 2, rand() % 2, w, h, hdc, rand() % 2, rand() % 2, SRCAND);
Sleep(10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment