Why WindowScreenShot does not save a picture ?

 

Hi,

I am trying to ""mate" WindowScreenShot function. Below is very simple expert. However it does not save picture to file.

What is the reason ?

Thanks in advance for help,

Edas

//+------------------------------------------------------------------+
//|                                            Screen_Show_multi.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        https://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net"

int handle;

//+------------------------------------------------------------------+
int init()
  {
//----
int handle=FileOpen(Symbol()+Period()+".gif",FILE_BIN|FILE_READ|FILE_WRITE);
string err;

  if(handle<1)
    {
     err=GetLastError();
     Alert("error(",err,")");
     return(0);
    }


WindowScreenShot( handle, 640, 480, 0, 0, CHART_CANDLE) ;
FileClose(handle);

   
//----
   return(0);
  }
 
first argument of WindowScreenShot is a string and not a filehandle...
 

This solved the problem :)

Thank you, zzuegg !

Reason: