Problem while converting mql4 script to mql5, WindowHandle?

 

I tried to compile the following mql4 code in mt5 Metaeditor

#import "user32.dll"
   int      PostMessageA(int hWnd,int Msg,int wParam,int lParam);
   int      GetWindow(int hWnd,int uCmd);
   int      GetParent(int hWnd);
#import

int start()
{      
   bool blnContinue = true;   
   int intParent = GetParent( WindowHandle( Symbol(), Period() ) );   
   int intChild = GetWindow( intParent, 0 );  
   int intCmd=33134; 
   
   if ( intChild > 0 )   
   {
      if ( intChild != intParent )   PostMessageA( intChild, 0x0111, intCmd, 0 );
   }
   else      blnContinue = false;   
   
   while( blnContinue )
   {
      intChild = GetWindow( intChild, 2 );   
   
      if ( intChild > 0 )   
      { 
         if ( intChild != intParent )   PostMessageA( intChild, 0x0111, intCmd, 0 );
      }
      else   blnContinue = false;   
   }
   
   // Now do the current window
   PostMessageA( intParent, 0x0111, intCmd, 0 );
   return(0);
}

and get the following error 'WindowHandle' - function not defined.

This code compliles in mt4 Metaeditor on the same computer without any problems.

This script converts the timeframes of all charts in a given profile to Daily timeframe. I have successfully converted several scripts from mql4 to mql5, but can't understand what's the problem here. Thanks.

 
Drop all that code and use the modern equivalents. ChartFirst, ChartNext, ChartSetSymbolPeriod.