-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpidHRemastered.cpp
35 lines (34 loc) · 1010 Bytes
/
pidHRemastered.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <Windows.h>
/* Made by: EthernalVortex */
typedef union _RGBQUAD {
COLORREF rgb;
struct {
BYTE r;
BYTE g;
BYTE b;
BYTE Reserved;
};
}_RGBQUAD, *PRGBQUAD;
INT main(INT argv, CHAR* argc[]) {
HDC hdcScreen = GetDC(0), hdcMem = CreateCompatibleDC(hdcScreen);
INT w = GetSystemMetrics(0), h = GetSystemMetrics(1);
BITMAPINFO bmi = { 0 };
PRGBQUAD rgbScreen = { 0 };
bmi.bmiHeader.biSize = sizeof(BITMAPINFO);
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biWidth = w;
bmi.bmiHeader.biHeight = h;
HBITMAP hbmTemp = CreateDIBSection(hdcScreen, &bmi, NULL, (void**)&rgbScreen, NULL, NULL);
SelectObject(hdcMem, hbmTemp);
for (;;) {
hdcScreen = GetDC(0);
BitBlt(hdcMem, 0, 0, w, h, hdcScreen, 0, 0, SRCCOPY);
for (INT i = 0; i < w * h; i++) {
INT x = i % w, y = i / w;
rgbScreen[i].rgb += x ^ y;
}
BitBlt(hdcScreen, 0, 0, w, h, hdcMem, 0, 0, SRCCOPY);
ReleaseDC(NULL, hdcScreen); DeleteDC(hdcScreen);
}
}