URL=https://www.youtube.com/watch?v=GDJujG0tBpQ
and have the code shell it. See:
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum (2015)
run a *.bat from EA (Route206) - MQL4 programming forum (2015)
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum (2016)
#property version "1.00" #import "shell32.dll" int ShellExecuteW(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd); #import int OnInit() { //exampel ObjectsDeleteAll(ChartID(),"BTN_"); /* Create Le button */ HS_Create_Btn(ChartID(),0,"BTN_LINK",200,20,10,10,"Arial",14,clrRoyalBlue,clrMidnightBlue,BORDER_FLAT,clrGoldenrod,ALIGN_CENTER,"Click Here",false,false); /* now you must link the button to the manage link function , go to the On Chart Event Section */ return(INIT_SUCCEEDED); } void Manage_Link(string the_link,string text_alt) { if(!IsDllsAllowed()) Alert(text_alt+"\n"+the_link); if(IsDllsAllowed()==true) ShellExecuteW(NULL,"open",the_link,"","",5); } bool IsDllsAllowed() { bool iz=(bool)MQLInfoInteger(MQL_DLLS_ALLOWED); return(iz); } //CREATE BTN OBJECT void HS_Create_Btn(long cid, int subw, string name, int sx, int sy, int px, int py, string font, int fontsize, color bck_col, color brd_col, ENUM_BORDER_TYPE brd_type, color txt_col, ENUM_ALIGN_MODE align, string text, bool selectable, bool back) { bool obji=ObjectCreate(cid,name,OBJ_BUTTON,subw,0,0); if(obji) { ObjectSetString(0,name,OBJPROP_FONT,font); ObjectSetInteger(0,name,OBJPROP_ALIGN,align); ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize); ObjectSetInteger(0,name,OBJPROP_XSIZE,sx); ObjectSetInteger(0,name,OBJPROP_YSIZE,sy); ObjectSetInteger(0,name,OBJPROP_XDISTANCE,px); ObjectSetInteger(0,name,OBJPROP_YDISTANCE,py); ObjectSetInteger(0,name,OBJPROP_BGCOLOR,bck_col); ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,brd_col); ObjectSetInteger(0,name,OBJPROP_COLOR,txt_col); ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,brd_type); ObjectSetInteger(0,name,OBJPROP_SELECTABLE,selectable); ObjectSetInteger(0,name,OBJPROP_BACK,back); ObjectSetString(0,name,OBJPROP_TEXT,text); } ChartRedraw(0); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- /* if an object is clicked and that object is the link */ if(id==CHARTEVENT_OBJECT_CLICK&&sparam=="BTN_LINK"){ /* we send them to the link , or , in case the user has their dlls off we display a message -you could get creative here and display a QR code as an alternative */ Manage_Link("https:\\www.google.com","Visit Google.com to buy the best pants!"); } }
Try this
I tried it myself and see what you mean. MetaQuotes may have changed the functionality to prevent loading it at all if it has DLL imports and you don't enable it. Since it has been a long time since I used DLLs, I don't know when this happened.
EDIT: This would mean that checking for DLL allowed in the code, will be of no use ...
EDIT2: ... unless the check MQL_DLLS_ALLOWED refers to the global permission only, when one enables the DLL for the EA but not for the global Options.
I tried it myself and see what you mean. MetaQuotes may have changed the functionality to prevent loading it at all if it has DLL imports and you don't enable it. Since it has been a long time since I used DLLs, I don't know when this happened.
EDIT: This would mean that checking for DLL allowed in the code, will be of no use, unless the check MQL_DLLS_ALLOWED refers to the global permission instead.
So a hesitant user justifiably won't run the EA if MQ is not allowing them to continue without dlls . (aside from the confusion it will cause)
(rofl emoji)
Maybe they attempted to simplify things so instead of the coder informing the user to enable dlls the program does not run at all without dlls.
The user will of course just abandon the program and never start it.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use