Open Chart by Script in MT4

 

Hi,

Is there any way in MT4 that make script or dll, able open chart by that(for example EURUSD) and next Press "F1" keyboard?

Regards,

 

this should do it:

#import "user32.dll"
   int GetAncestor(int hWnd, int gaFlags);
   int GetDlgItem(int hDlg, int nIDDlgItem);
   int PostMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_COMMAND   0x0111
#define WM_KEYDOWN   0x0100
#define VK_HOME      0x0024
#define VK_DOWN      0x0028

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
void start()
{
   int hFile, SymbolsTotal, hTerminal, hWnd;
   string symbol;

   hFile = FileOpenHistory("symbols.sel", FILE_BIN|FILE_READ);
   if(hFile < 0) return(-1);

   SymbolsTotal = (FileSize(hFile) - 4) / 128;
   FileSeek(hFile, 4, SEEK_SET);

   hTerminal = GetAncestor(WindowHandle(Symbol(), Period()), 2);

   hWnd = GetDlgItem(hTerminal, 0xE81C);
   hWnd = GetDlgItem(hWnd, 0x50);
   hWnd = GetDlgItem(hWnd, 0x8A71);

   PostMessageA(hWnd, WM_KEYDOWN, VK_HOME, 0);

   for(int i = 0; i < SymbolsTotal; i++)
   {
      symbol = FileReadString(hFile, 12);
      if(StringFind(symbol,"EURUSD") == -1)
      {
         PostMessageA(hTerminal, WM_COMMAND, 33160, 0);
         break;
      }
      PostMessageA(hWnd, WM_KEYDOWN, VK_DOWN, 0);
      FileSeek(hFile, 116, SEEK_CUR);
   }

   FileClose(hFile);

   return;
}

what do you mean about F1?

 
alladir:

this should do it:

what do you mean about F1?


Thanks.

I mean how press "F11" Key by Script.

I want make Full screen chart.

Reason: