Randomly moves the window round. Only Ctrl+Alt+Del will work here.

This commit is contained in:
Minhas Kamal
2017-01-19 01:03:16 +06:00
committed by GitHub
parent 991cf6ff2c
commit 2ff5eeafd9

View File

@@ -4,29 +4,24 @@
#include <math.h>
DWORD WINAPI moveit(){
int i,j,k;
HWND a=GetForegroundWindow();
for(k=0;;k++){
i=400+150*cos(k);
j=200+150*sin(k);
int i,j,k=1;
while(k++){
i=200+300*cos(k);
j=150+300*sin(k);
MoveWindow(a,i,j,i,j,1);
Sleep(40);
Sleep(50);
}
}
main(){
DWORD dwThreadId;
HWND tmp = GetForegroundWindow();
HWND last = tmp;
ShowWindow(tmp, SW_HIDE);
Sleep(1000);
HWND last=GetForegroundWindow();
ShowWindow(last, SW_HIDE);
while(1){
tmp = GetForegroundWindow();
if(tmp != last){
CreateThread(NULL, 0, moveit, &tmp, 0, &dwThreadId);
last = tmp;
if(last!=GetForegroundWindow()){
last=GetForegroundWindow();
CreateThread(NULL, 0, moveit, &last, 0, &dwThreadId);
}
}
}