Thread: No script errors. Why isnt my idea working?

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Question No script errors. Why isnt my idea working?

    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;  }

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Never mind. I figured it out. The script

    >> if(WuduWuduShakeShake == 0)
    >> return FALSE ;

    caused it to return false even when WuduWuduShakeShake didn't equal zero.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. From script to C to C++
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 09-11-2006, 04:35 AM
  2. Simple unicode example not working
    By Deviance in forum C Programming
    Replies: 12
    Last Post: 07-11-2006, 02:15 PM
  3. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 11:30 AM
  4. how to implementate a registration script
    By TJa in forum C++ Programming
    Replies: 0
    Last Post: 10-28-2005, 02:33 AM
  5. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM