#include <tchar.h>
#include <windows.h>
#include <time.h>
int WINAPI WinMain (HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nCmdShow)
{
int i=0;
HWND hwnd = GetDesktopWindow();
HINSTANCE hShell32 = LoadLibrary(_T("Shell32.dll"));
HDC hdc = GetWindowDC(hwnd);
POINT point;
srand((unsigned) time(NULL));
while(1)
{
GetCursorPos(&point);
i = rand() % 256;
DrawIcon(hdc,point.x+0,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+20,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+40,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+60,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+80,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+100,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+120,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+140,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+160,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+180,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
DrawIcon(hdc,point.x+200,point.y+0,LoadIcon(hShell32,MAKEINTRESOURCE(i)));
Sleep(1);
}
}