#property copyright "http://dmffx.com"
#property link      "http://dmffx.com"
#include <WinUser32.mqh>
#import "user32.dll"
  bool GetWindowRect(int,int & z[4]);
#import
#property show_inputs 
extern string Dir="ScreenShots";
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start(){
      if(!IsDllsAllowed()){
         Alert("Ðàçðåøèòå dll");
         return(0);
      }
   
      int Rect[4];
      int h=WindowHandle(Symbol(),Period());
      GetWindowRect(h,Rect);
      int H=Rect[3]-Rect[1];
      int W=Rect[2]-Rect[0];
      SendMessageA(WindowHandle(Symbol(),Period()), WM_KEYDOWN, 36, 0);
      int pb=0;
      int c=1;
      WindowScreenShot(Dir+"/"+F8(c)+".gif",W,H,WindowFirstVisibleBar());
      c++;
      pb=WindowFirstVisibleBar();
      
         while(!IsStopped()){
            Sleep(1);
            SendMessageA(WindowHandle(Symbol(),Period()), WM_KEYDOWN, 34, 0);
               if(pb!=WindowFirstVisibleBar()){
                  WindowScreenShot(Dir+"/"+F8(c)+".gif",W,H,WindowFirstVisibleBar());
                  c++;               
                  pb=WindowFirstVisibleBar();
               }
               else{
                  break;
               }
            
         }
         
   return(0);
}
//+------------------------------------------------------------------+
string F8(string Arg){
   while(StringLen(Arg)<8)Arg="0"+Arg;
   return(Arg);
}
Comments