
#property indicator_chart_window
#import "shell32.dll" //Connect a dll (provided with Windows)
int ShellExecuteA(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import "user32.dll"
int MessageBoxA(int hWnd ,string lpText,string lpCaption,int uType);
#import
// Тут тело программы
//
void CheckDonate()
{
int fd=0; string pay="0"; datetime dt=0;
string fn="VisualOrders.txt";
fd=FileOpen(fn,FILE_READ|FILE_CSV,";");
if(fd>=1)
{
pay=FileReadString(fd); if(pay!="0" && pay!="1") pay="0";
dt=StrToTime(FileReadString(fd));
}
else
{
dt=TimeCurrent();
fd=FileOpen(fn,FILE_WRITE|FILE_CSV,";");
FileWrite(fd,"0",TimeToStr(dt,TIME_DATE));
}
FileClose(fd);
if(pay=="0" && (TimeCurrent()-dt)>10*24*60*60) // 5 дней
{
if(MessageBoxA(0,"Если Вам понравился индикатор VisualOrders,\n хотите помочь автору материально?","Вопрос",4)==6)
{
ShellExecuteA(0,"Open","iexplore.exe","wmk<img src='http://opentraders.ru/templates/skin/g6h/images/smilies/008.gif' alt=' :P '> ayto?Purse=R865705290089&Amount=100&Desc=Indicator&BringToFront=Y&ExecEvenKeeperIsOffline=Y","",7);
pay="1";
}
dt=TimeCurrent();
fd=FileOpen(fn,FILE_WRITE|FILE_CSV,";");
FileWrite(fd,pay,TimeToStr(dt,TIME_DATE));
FileClose(fd);
}
FileClose(fd);
}
Завтра буду смотреть.
добавить параметр время работы советника)
Kofa