├── requirements.txt ├── .gitignore ├── GDI effects ├── Invert │ └── Invert.py ├── Stretch │ ├── StretchHori.py │ └── StretchVert.py ├── Melt │ └── Melt.py ├── Errors │ ├── RandomErrors.py │ └── Errors.py ├── BwHell │ └── BwHell.py ├── Camo │ └── Camo.py ├── PanScreen │ └── PanScreen.py ├── Tunnel │ └── Tunnel.py ├── void │ └── void.py ├── SwipeScreen │ └── SwipeScreen.py ├── Waves │ └── waves.py ├── RotatingTunnel │ └── RotTun.py ├── RainbowSpaghetti │ └── Spaghetti.py ├── RainbowHell │ └── Rainbow hell.py ├── Circles │ └── Circles.py ├── Triangles │ └── Triangles.py └── Xor │ └── Xor.py ├── LICENSE └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | pywin32 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test.py 2 | .venv -------------------------------------------------------------------------------- /GDI effects/Invert/Invert.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import ctypes 3 | import time 4 | 5 | hdc = win32gui.GetDC(0) 6 | user32 = ctypes.windll.user32 7 | user32.SetProcessDPIAware() 8 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 9 | while True: 10 | win32gui.InvertRect(hdc, (0, 0, w, h)) 11 | time.sleep(0.2) # Adjust delay to your liking 12 | -------------------------------------------------------------------------------- /GDI effects/Stretch/StretchHori.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | 5 | 6 | hdc = win32gui.GetDC(0) 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | 11 | while True: 12 | hdc = win32gui.GetDC(0) 13 | win32gui.StretchBlt(hdc, -20, 0, sw + 40, sh, hdc, 0, 0, sw, sh, win32con.SRCCOPY) 14 | win32gui.ReleaseDC(0, hdc) 15 | -------------------------------------------------------------------------------- /GDI effects/Stretch/StretchVert.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | 5 | 6 | hdc = win32gui.GetDC(0) 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | 11 | while True: 12 | hdc = win32gui.GetDC(0) 13 | win32gui.StretchBlt(hdc, 0, -20, sw, sh + 40, hdc, 0, 0, sw, sh, win32con.SRCCOPY) 14 | win32gui.ReleaseDC(0, hdc) 15 | -------------------------------------------------------------------------------- /GDI effects/Melt/Melt.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import random 5 | import time 6 | 7 | 8 | hdc = win32gui.GetDC(0) 9 | user32 = ctypes.windll.user32 10 | user32.SetProcessDPIAware() 11 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 12 | 13 | 14 | x = y = 0 15 | while True: 16 | hdc = win32gui.GetDC(0) 17 | x = random.randint(0, w) 18 | win32gui.BitBlt(hdc, x, 1, 10, h, hdc, x, 0, win32con.SRCCOPY) 19 | win32gui.ReleaseDC(0, hdc) 20 | -------------------------------------------------------------------------------- /GDI effects/Errors/RandomErrors.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import random 5 | 6 | hdc = win32gui.GetDC(0) 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | 11 | 12 | while True: 13 | win32gui.DrawIcon( 14 | hdc, 15 | random.randint(0, w), 16 | random.randint(0, h), 17 | win32gui.LoadIcon(None, win32con.IDI_ERROR), 18 | ) # Change IDI_ERROR to something else to change the icon being displayed 19 | -------------------------------------------------------------------------------- /GDI effects/BwHell/BwHell.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import math 5 | import random 6 | 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | hdc = win32gui.GetDC(0) 11 | 12 | while True: 13 | 14 | win32gui.BitBlt( 15 | hdc, 16 | 0, 17 | 0, 18 | sw, 19 | sh, 20 | hdc, 21 | random.randrange(-3, 4), 22 | random.randrange(-3, 4), 23 | win32con.NOTSRCCOPY, 24 | ) 25 | -------------------------------------------------------------------------------- /GDI effects/Errors/Errors.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | 5 | 6 | hdc = win32gui.GetDC(0) 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | 11 | 12 | x = y = 0 13 | while True: 14 | win32gui.DrawIcon(hdc, x , y , win32gui.LoadIcon(None, win32con.IDI_ERROR)) # Change IDI_ERROR to something else to change the icon being displayed 15 | x = x + 30 16 | if x >= w: 17 | y = y + 30 18 | x = 0 19 | if y >= h: 20 | x = y = 0 21 | -------------------------------------------------------------------------------- /GDI effects/Camo/Camo.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import random 5 | import time 6 | 7 | 8 | hdc = win32gui.GetDC(0) 9 | user32 = ctypes.windll.user32 10 | user32.SetProcessDPIAware() 11 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 12 | 13 | 14 | while True: 15 | hdc = win32gui.GetDC(0) 16 | x = random.randint(0, w) 17 | win32gui.BitBlt(hdc, random.randint(0, 666), random.randint(0, 666), w, h, hdc, random.randint(0, 666), random.randint(0, 666), win32con.NOTSRCERASE) 18 | win32gui.ReleaseDC(0, hdc) 19 | time.sleep(.01) 20 | -------------------------------------------------------------------------------- /GDI effects/PanScreen/PanScreen.py: -------------------------------------------------------------------------------- 1 | 2 | import win32gui 3 | import win32con 4 | import ctypes 5 | import math 6 | 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | hdc = win32gui.GetDC(0) 11 | dx = dy = 1 12 | angle = 0 13 | size = 1 14 | speed = 5 15 | while True: 16 | 17 | win32gui.BitBlt(hdc, 0, 0, sw, sh, hdc, dx, dy, win32con.SRCCOPY) 18 | dx = math.ceil(math.sin(angle) * size * 10) 19 | dy = math.ceil(math.cos(angle) * size * 10) 20 | angle += speed / 10 21 | if angle > math.pi : 22 | angle = math.pi * -1 23 | -------------------------------------------------------------------------------- /GDI effects/Tunnel/Tunnel.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | from time import sleep 5 | 6 | hdc = win32gui.GetDC(0) 7 | user32 = ctypes.windll.user32 8 | user32.SetProcessDPIAware() 9 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 10 | 11 | delay = 0.1 12 | size = 100 13 | while True: 14 | hdc = win32gui.GetDC(0) 15 | win32gui.StretchBlt( 16 | hdc, 17 | int(size / 2), 18 | int(size / 2), 19 | sw - size, 20 | sh - size, 21 | hdc, 22 | 0, 23 | 0, 24 | sw, 25 | sh, 26 | win32con.SRCCOPY, 27 | ) 28 | sleep(delay) 29 | -------------------------------------------------------------------------------- /GDI effects/void/void.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import random 5 | import time 6 | 7 | 8 | hdc = win32gui.GetDC(0) 9 | user32 = ctypes.windll.user32 10 | user32.SetProcessDPIAware() 11 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 12 | 13 | 14 | x = y = 0 15 | while True: 16 | hdc = win32gui.GetDC(0) 17 | win32gui.BitBlt( 18 | hdc, 19 | random.randint(1, 10) % 2, 20 | random.randint(1, 10) % 2, 21 | w, 22 | h, 23 | hdc, 24 | random.randint(1, 1000) % 2, 25 | random.randint(1, 1000) % 2, 26 | win32con.SRCAND, 27 | ) 28 | time.sleep(0.01) 29 | win32gui.ReleaseDC(0, hdc) 30 | -------------------------------------------------------------------------------- /GDI effects/SwipeScreen/SwipeScreen.py: -------------------------------------------------------------------------------- 1 | # a 1 2 | 3 | import win32api 4 | import win32con 5 | import win32gui 6 | import math 7 | import time 8 | import ctypes 9 | 10 | 11 | def sines(): 12 | user32 = ctypes.windll.user32 13 | user32.SetProcessDPIAware() 14 | desktop = win32gui.GetDesktopWindow() 15 | hdc = win32gui.GetWindowDC(desktop) 16 | sw = win32api.GetSystemMetrics(0) 17 | sh = win32api.GetSystemMetrics(1) 18 | angle = 0 19 | 20 | while True: 21 | hdc = win32gui.GetWindowDC(desktop) 22 | n = 0 23 | for i in range(int(sw + sh)): 24 | a = int(math.sin(n) * 20) 25 | win32gui.BitBlt(hdc, 0, 0, sw, sh, hdc, a, 0, win32con.SRCCOPY) 26 | n += 0.1 27 | win32gui.ReleaseDC(desktop, hdc) 28 | time.sleep(0.01) 29 | 30 | 31 | if __name__ == "__main__": 32 | sines() 33 | -------------------------------------------------------------------------------- /GDI effects/Waves/waves.py: -------------------------------------------------------------------------------- 1 | import win32api 2 | import win32con 3 | import win32gui 4 | import math 5 | import time 6 | 7 | 8 | def sines(): 9 | desktop = win32gui.GetDesktopWindow() 10 | hdc = win32gui.GetWindowDC(desktop) 11 | sw = win32api.GetSystemMetrics(0) 12 | sh = win32api.GetSystemMetrics(1) 13 | angle = 0 14 | scaling_factor = 10 # Adjust this value for performance vs. visual quality 15 | 16 | while True: 17 | hdc = win32gui.GetWindowDC(desktop) 18 | for i in range(0, int(sw + sh), scaling_factor): 19 | # Scale the amplitude of the sine wave 20 | a = int(math.sin(angle) * 20 * (scaling_factor)) 21 | win32gui.BitBlt(hdc, 0, i, sw, scaling_factor, hdc, a, i, win32con.SRCCOPY) 22 | angle += math.pi / 40 23 | win32gui.ReleaseDC(desktop, hdc) 24 | 25 | 26 | if __name__ == "__main__": 27 | sines() 28 | -------------------------------------------------------------------------------- /GDI effects/RotatingTunnel/RotTun.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | from win32gui import * 3 | import ctypes 4 | 5 | user32 = ctypes.windll.user32 6 | user32.SetProcessDPIAware() 7 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 8 | 9 | screen_size = win32gui.GetWindowRect(win32gui.GetDesktopWindow()) 10 | 11 | left = screen_size[0] 12 | top = screen_size[1] 13 | right = screen_size[2] 14 | bottom = screen_size[3] 15 | 16 | 17 | lpppoint = ((left + 50, top - 50), (right + 50, top + 50), (left - 50, bottom - 50)) 18 | 19 | 20 | while True: 21 | 22 | hdc = win32gui.GetDC(0) 23 | mhdc = CreateCompatibleDC(hdc) 24 | hbit = CreateCompatibleBitmap(hdc, sh, sw) 25 | holdbit = SelectObject(mhdc, hbit) 26 | 27 | PlgBlt( 28 | hdc, 29 | lpppoint, 30 | hdc, 31 | left - 20, 32 | top - 20, 33 | (right - left) + 40, 34 | (bottom - top) + 40, 35 | None, 36 | 0, 37 | 0, 38 | ) 39 | -------------------------------------------------------------------------------- /GDI effects/RainbowSpaghetti/Spaghetti.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import win32api 4 | import ctypes 5 | import random 6 | import colorsys 7 | 8 | hdc = win32gui.GetDC(0) 9 | user32 = ctypes.windll.user32 10 | user32.SetProcessDPIAware() 11 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 12 | color = 0 13 | 14 | x = y = 0 15 | while True: 16 | hdc = win32gui.GetDC(0) 17 | 18 | # Increment and wrap the hue value adjust as needed (default is 0.02) 19 | color = (color + 0.02) % 1.0 20 | 21 | rgb_color = colorsys.hsv_to_rgb(color, 1.0, 1.0) 22 | p = [(random.randint(0, w), random.randint(0, h)) for _ in range(4)] 23 | 24 | hPen = win32gui.CreatePen( 25 | win32con.PS_SOLID, 26 | 5, 27 | win32api.RGB( 28 | int(rgb_color[0] * 255), int(rgb_color[1] * 255), int(rgb_color[2] * 255) 29 | ), 30 | ) 31 | 32 | win32gui.SelectObject(hdc, hPen) 33 | win32gui.PolyBezier(hdc, p) 34 | win32gui.DeleteObject(hPen) 35 | win32gui.ReleaseDC(0, hdc) 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 3 | Copyright 2024 Leo Aqua Felix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /GDI effects/RainbowHell/Rainbow hell.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32api 3 | import win32con 4 | import random 5 | import ctypes 6 | import colorsys 7 | 8 | user32 = ctypes.windll.user32 9 | user32.SetProcessDPIAware() 10 | [sw, sh] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 11 | 12 | color = 0 13 | while True: 14 | hdc = win32gui.GetDC(0) 15 | 16 | rgb_color = colorsys.hsv_to_rgb(color, 1.0, 1.0) 17 | 18 | brush = win32gui.CreateSolidBrush( 19 | win32api.RGB( 20 | int(rgb_color[0]) * 255, int(rgb_color[1]) * 255, int(rgb_color[2]) * 255 21 | ) 22 | ) 23 | win32gui.SelectObject(hdc, brush) 24 | win32gui.BitBlt( 25 | hdc, 26 | random.randint(-10, 10), 27 | random.randint(-10, 10), 28 | sw, 29 | sh, 30 | hdc, 31 | 0, 32 | 0, 33 | win32con.SRCCOPY, 34 | ) 35 | win32gui.BitBlt( 36 | hdc, 37 | random.randint(-10, 10), 38 | random.randint(-10, 10), 39 | sw, 40 | sh, 41 | hdc, 42 | 0, 43 | 0, 44 | win32con.PATINVERT, 45 | ) 46 | color += 0.05 47 | -------------------------------------------------------------------------------- /GDI effects/Circles/Circles.py: -------------------------------------------------------------------------------- 1 | import win32gui 2 | import win32con 3 | import ctypes 4 | import random 5 | import time 6 | from ctypes import wintypes 7 | 8 | user32 = ctypes.windll.user32 9 | user32.SetProcessDPIAware() 10 | [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)] 11 | 12 | gdi32 = ctypes.WinDLL('gdi32') 13 | gdi32.SelectClipRgn.argtypes = [wintypes.HDC, wintypes.HRGN] 14 | gdi32.SelectClipRgn.restype = ctypes.c_int 15 | 16 | hdc = win32gui.GetDC(0) 17 | 18 | 19 | 20 | screen_size = win32gui.GetWindowRect(win32gui.GetDesktopWindow()) 21 | 22 | left = screen_size[0] 23 | top = screen_size[1] 24 | right = screen_size[2] 25 | bottom = screen_size[3] 26 | 27 | w = right - left - 500 28 | h = bottom - top - 500 29 | 30 | 31 | 32 | def ci(x,y,w,h): 33 | hdc = win32gui.GetDC(0) 34 | 35 | x = int(x) 36 | y = int(y) 37 | w = int(w) 38 | h = int(h) 39 | hrgn = win32gui.CreateEllipticRgnIndirect((x, y, x + w, y + h)) 40 | gdi32.SelectClipRgn(hdc, hrgn.handle) 41 | win32gui.BitBlt(hdc, x, y, w, h, hdc, x, y, win32con.NOTSRCCOPY) 42 | 43 | # Remove clipping region by passing NULL (0) 44 | gdi32.SelectClipRgn(hdc, 0) 45 | 46 | win32gui.DeleteObject(hrgn) 47 | win32gui.ReleaseDC(0, hdc) 48 | 49 | 50 | 51 | while(True): 52 | size = 1000 53 | x = random.randint(0, w + size - 1) - size / 2 54 | y = random.randint(0, h + size - 1) - size / 2 55 | i = 0 56 | while(i [!IMPORTANT] 73 | > ## DISCLAIMER 74 | > Don't be a skid. Do not use any of the code in this repo for harm. 75 | > 76 | > I do not take responsibility for any damages. 77 | > 78 | > And most importantly: Have fun and happy programming! :D 79 | -------------------------------------------------------------------------------- /GDI effects/Xor/Xor.py: -------------------------------------------------------------------------------- 1 | import ctypes 2 | import time 3 | import win32con 4 | import win32gui 5 | import win32ui 6 | import win32api 7 | 8 | # Define BITMAPINFOHEADER + BITMAPINFO 9 | class BITMAPINFOHEADER(ctypes.Structure): 10 | _fields_ = [ 11 | ("biSize", ctypes.c_uint32), 12 | ("biWidth", ctypes.c_int32), 13 | ("biHeight", ctypes.c_int32), 14 | ("biPlanes", ctypes.c_uint16), 15 | ("biBitCount", ctypes.c_uint16), 16 | ("biCompression", ctypes.c_uint32), 17 | ("biSizeImage", ctypes.c_uint32), 18 | ("biXPelsPerMeter", ctypes.c_int32), 19 | ("biYPelsPerMeter", ctypes.c_int32), 20 | ("biClrUsed", ctypes.c_uint32), 21 | ("biClrImportant", ctypes.c_uint32), 22 | ] 23 | 24 | class BITMAPINFO(ctypes.Structure): 25 | _fields_ = [("bmiHeader", BITMAPINFOHEADER), ("bmiColors", ctypes.c_uint32 * 1)] 26 | 27 | # Get screen size 28 | width = win32api.GetSystemMetrics(0) 29 | height = win32api.GetSystemMetrics(1) 30 | 31 | # Create screen DC and compatible DC 32 | hdc_screen = win32gui.GetDC(0) 33 | hdc_screen_ui = win32ui.CreateDCFromHandle(hdc_screen) 34 | hdc_mem = hdc_screen_ui.CreateCompatibleDC() 35 | 36 | # Set up BITMAPINFO 37 | bmi = BITMAPINFO() 38 | bmi.bmiHeader.biSize = ctypes.sizeof(BITMAPINFOHEADER) 39 | bmi.bmiHeader.biWidth = width 40 | bmi.bmiHeader.biHeight = -height # top-down 41 | bmi.bmiHeader.biPlanes = 1 42 | bmi.bmiHeader.biBitCount = 32 43 | bmi.bmiHeader.biCompression = win32con.BI_RGB 44 | 45 | # Prepare pointer for pixel data 46 | pixel_ptr = ctypes.c_void_p() 47 | 48 | # Call CreateDIBSection from gdi32 49 | gdi32 = ctypes.windll.gdi32 50 | dib = gdi32.CreateDIBSection( 51 | hdc_screen, # HDC 52 | ctypes.byref(bmi), # BITMAPINFO* 53 | win32con.DIB_RGB_COLORS, # color usage 54 | ctypes.byref(pixel_ptr), # output: pixel buffer ptr 55 | None, 0 # no file mapping 56 | ) 57 | 58 | # Wrap handle in PyCBitmap 59 | bitmap = win32ui.CreateBitmapFromHandle(dib) 60 | hdc_mem.SelectObject(bitmap) 61 | 62 | # Cast pixel_ptr to a pointer to array of 32-bit ints 63 | pixel_array = ctypes.cast(pixel_ptr, ctypes.POINTER(ctypes.c_uint32)) 64 | 65 | # Infinite fractal loop 66 | while True: 67 | hdc_screen = win32gui.GetDC(0) 68 | 69 | # Capture screen 70 | win32gui.BitBlt(hdc_mem.GetSafeHdc(), 0, 0, width, height, hdc_screen, 0, 0, win32con.SRCCOPY) 71 | 72 | # Apply XOR fractal effect 73 | for i in range(width * height): 74 | x = i % width 75 | y = i // width 76 | xor_val = x ^ y 77 | 78 | color = pixel_array[i] # Change colors below 79 | r = (color >> 16) & 0xFF 80 | g = (color >> 8) & 0xFF 81 | b = color & 0xFF 82 | 83 | r = (r + xor_val) & 0xFF 84 | g = (g + xor_val) & 0xFF 85 | b = (b + xor_val) & 0xFF 86 | 87 | pixel_array[i] = r | (g << 8) | (b << 16) 88 | 89 | # Draw back to screen 90 | hdc_screen_ui.BitBlt((0, 0), (width, height), hdc_mem, (0, 0), win32con.SRCCOPY) 91 | 92 | win32gui.ReleaseDC(0, hdc_screen) 93 | 94 | --------------------------------------------------------------------------------