#include <Windows.h> #include <windows.h> #include "stdafx.h" int scrWidth; int scrHeight; int intervalspeed = 100; LRESULT CALLBACK HyperGoto(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CREATE: { HDC desktop = GetDC(HWND_DESKTOP); HDC window = GetDC(hWnd); if (desktop && window) { BitBlt(window, 0, 0, scrWidth, scrHeight, desktop, 0, 0, SRCCOPY); } if (window) ReleaseDC(hWnd, window); if (desktop) ReleaseDC(HWND_DESKTOP, desktop); SetTimer(hWnd, 0, intervalspeed, 0); ShowWindow(hWnd, SW_SHOW); break; } case WM_PAINT: { ValidateRect(hWnd, 0); break; } case WM_TIMER: { HDC wndw = GetDC(hWnd); if (wndw) { int x = (rand() % scrWidth) - (200 / 2); int y = (rand() % 15); int width = (rand() % 200); BitBlt(wndw, x, y, width, scrHeight, wndw, x, 0, SRCCOPY); ReleaseDC(hWnd, wndw); } break; } case WM_DESTROY: { KillTimer(hWnd, 0); PostQuitMessage(0); break; } default: return DefWindowProc(hWnd, msg, wParam, lParam); } return 0; } int APIENTRY WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int showCmd) { scrWidth = GetSystemMetrics(SM_CXSCREEN); scrHeight = GetSystemMetrics(SM_CYSCREEN); WNDCLASSEX wndClass = { 0 }; wndClass.cbSize = sizeof(WNDCLASSEX); wndClass.style = CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = HyperGoto; wndClass.hInstance = inst; wndClass.hIcon = LoadIcon(0, IDI_APPLICATION); wndClass.hCursor = LoadCursor(0, IDC_ARROW); wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wndClass.lpszClassName = "HyperGoto.exe"; if (RegisterClassEx(&wndClass)) { HWND hWnd = CreateWindowExA(WS_EX_TOPMOST, "HyperGoto.exe", "Hypergoto.exe", WS_POPUP, 0, 0, scrWidth, scrHeight, HWND_DESKTOP, 0, inst, 0); if (hWnd) { srand(GetTickCount()); MSG msg = { 0 }; ShowWindow(hWnd, showCmd); while (msg.message != WM_QUIT) { if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int)msg.wParam; } } return 0; }