No script errors. Why isnt my idea working?
I have allready tried replaceing the rand()s with a 2, but it still wont do anything.
Code:
#include <windows.h>
int centerX;
int centerY;
int WuduWuduShakeShake;
int ShakeMeX;
int ShakeMeY;
BOOL CALLBACK EnumChildProc( HWND hwndChild, LPARAM lParam )
{
LPSTR pszFileText;
WINDOWINFO pwiChild;
GetWindowInfo(hwndChild,&pwiChild);
ShakeMeX = rand()%3 + 0;
ShakeMeY = rand()%3 + 0;
WuduWuduShakeShake--;
if(ShakeMeY == 0)
centerY = pwiChild.rcWindow.top + 0;
else if(ShakeMeY == 1)
centerY = pwiChild.rcWindow.top - WuduWuduShakeShake;
else if(ShakeMeY == 2)
centerY = pwiChild.rcWindow.top + WuduWuduShakeShake;
if(ShakeMeX == 0)
centerY = pwiChild.rcWindow.left + 0;
else if(ShakeMeX == 1)
centerY = pwiChild.rcWindow.left - WuduWuduShakeShake;
else if(ShakeMeX == 2)
centerY = pwiChild.rcWindow.left + WuduWuduShakeShake;
SetWindowPos(hwndChild,HWND_TOP,centerX,centerY,0,0,SWP_NOSIZE|SWP_NOZORDER);
if(WuduWuduShakeShake == 0)
return FALSE ;
int* count = (int*) lParam ;
(*count)++;
Sleep(1000);
return TRUE ;
}
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nFunsterStil) {
HWND hwndMother;
int count = 0 ;
WuduWuduShakeShake = 10;
hwndMother = FindWindow("SysListView32", 0);
for(;;)
if(!EnumChildWindows(hwndMother, EnumChildProc, (LPARAM)&count))
break;
return 0; }