An interesting GDI graphic test program

zhaozj2021-02-16  193

This is an interesting GDI graphic test program. Its main function is to draw on the desktop. The result is ... Your desktop will be a group, like a virus, see you will be scared, but there is no risk: )

The program is compiled under VC . Net.

#include "stdafx.h" #include "stdlib.h"

int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {MessageBox (NULL, "Written by Cooldog :).", "hehe ...", MB_OK); HDC myDC; // get the screen resolution RECT ScrRect; getWindowRect (getDesktopWindow (), & scrRect); mydc = getdc ((hwnd) 0); // Get device environment for (long i = 0; i <100000L; i ) {int x, y, width, height; x = (RAND ()% scrRect.right) / 2- (width = rand ()% 3); // Random generate coordinate y = rand ()% scrult.bottom- (height = rand ()% 3); Bitblt MYDC, X, Y, X Width, Y Height, MYDC, X RAND ()% 3-1, Y-Rand ()% 2, Srccopy; // Drawing} ReleaseDC ((HWND) 0, MYDC) InvalidateRect (0, null, true); return 0;}

转载请注明原文地址:https://www.9cbs.com/read-8152.html

New Post(0)