一般那些病毒不只是错误图标,是鼠标乱飞和错误图标结合。
#include<iostream>
#include<windows.h>
using namespace std;
int main(){
int iDesktopWidth = GetSystemMetrics(SM_CXSCREEN);
int iDesktopHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktop = GetDesktopWindow();
HDC hdc = GetWindowDC(hDesktop);
while(true){
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
SetCursorPos(rand()%x,rand()%y);
POINT cursor;
GetCursorPos(&cursor);
DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_ERROR));
}
}