A funny joke application makes your window dance

These days I am so busy with work, and haven’t got time to write anything.

This is a funny joke application I wrote long time back. It will make your front window dance. If you press any key, this application will exit.

You can download here
This is the code, in case if you want to make your own.

#include "stdafx.h"
#include "math.h"
#include "windows.h"
#include "time.h"
#include "conio.h"

int _tmain(int argc, _TCHAR* argv[])
{
	RECT rect;
	int offset;
	while(!kbhit())
	{
		HWND hWnd = GetForegroundWindow();
		GetWindowRect(hWnd,&rect);
		offset = sin((float)rand())*10;
		rect.left += offset;
		rect.bottom += offset;
		rect.right += offset;
		rect.top += offset;
		MoveWindow(hWnd,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,true);
		Sleep(20);
	}
	return 0;
}