reading the Journal in real time

To add comments, please log in or register
qjol
3196
qjol  

unfortunately I have not found yet the right way how to do this but at least i found a detour if anyone has a direct way to do that i would be grateful

the way i found is by forcing the terminal to save the data through opening the folder that contains the log files

#include <WinUser32.mqh>

#import "user32.dll"
  int GetAncestor(int hWnd, int gaFlags);
#import
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
void start()
{
  int hwnd = GetAncestor(WindowHandle(Symbol(),Period()),2); // find the Terminal handle no.
  PostMessageA(hwnd,WM_COMMAND ,33101,0); // open the folder contains the log files
  //-----
  while (FindIfDirOpened() == 0) // check if the folder opened
      {
      Sleep(100);
      FindIfDirOpened();
      }
   PostMessageA(FindIfDirOpened(), WM_CLOSE, 0, 0); //close the folder
}

int FindIfDirOpened()
   {
   string log = "logs";
   string i;
   int handle = FindWindowA(i ,log);
   return(handle);
   }
Francesco Fava
1052
Francesco Fava  
Yes, but open the log folder before MQL4...   ....\uniquenumber\log NOT the one on ...\uniquenumber\MQL4\Logs 
To add comments, please log in or register