int handle = FileOpen(filename,FILE_CSV|FILE_READ); if( handle<1 ) // save screenshot else FileClose(handle);
Next time:

Gordon, Thanks. I tarial now.
Gordon,
Your code is fine, the problem of my code is don't close the file (this mean the file is always opening ) then cannot delete the file .
Thanks.
Gordon,
There are something wrong
filename = ticket()+"_Open.gif";
int handle = FileOpen(filename,FILE_CSV|FILE_READ);
if( handle<1 )
// save screenshot
else
FileClose(handle);
________________
The above code always take screen shot every tick ! I want take once only, how to solve ?
Thanks.
Gordon,
There are something wrong
filename = ticket()+"_Open.gif";
int handle = FileOpen(filename,FILE_CSV|FILE_READ);
if( handle<1 )
// save screenshot
else
FileClose(handle);
________________
The above code always take screen shot every tick ! I want take once only, how to solve ?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Folks
1) I am an EA developer and FX trader
2) I want keep every opened orderscreen shot for review (Trainng)
3) I use the following code to check the file which is existing, but something wrong, becuase the file will be open then some error.
ticket=OrderTicket();
filename = ticket
if(FileOpen(filename,FILE_CSV|FILE_READ) < 1 )
{
if(!WindowScreenShot(filename,640,480)) Print("WindowScreenShot error: "+GetLastError());
}
else
{
FileClose(FileOpen(filename,FILE_CSV|FILE_READ));
}
finally, I want some code,it simple
if file is not exist, thake WindowScreenShot
Anyboby can help me, thanks