Code to Reference the Experts Log Folder with PostMessageW

 

Hi,

I'm working with the WinAPI functions and I want my code to open the folder containing the Experts Log.

Does anyone know the code to use in PostMessageW to reference the Experts Log?

Does a list of these codes and their commands exist anywhere? 

 

I have a script (below) that will do this with the Journal folder using code "33101" - I need to find the corresponding code to Experts Log.

 

#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.
  PostMessageW(hwnd,WM_COMMAND ,33101,0); // open the folder contains the log files
  //-----
  while (FindIfDirOpened() == 0) // check if the folder opened
      {
      Sleep(100);
      FindIfDirOpened();
      }
   PostMessageW(FindIfDirOpened(), WM_CLOSE, 0, 0); //close the folder
}

int FindIfDirOpened()
   {
   string log = "logs";
   string i;
   int handle = FindWindowW(i ,log);
   return(handle);
   }
 
hi 

how can i auto update expert log file when terminal is runing 
i have an idea which is open expert log folder from right click on expert toolbox(terminal) and click on open >> then log file(yyyy:mm:dd) get updated

and i wrote it with python 
# !pip install pyautogui
# !pip install datetime
import requests
import pyautogui

import time
from datetime import datetime


def TelegramBot(post): 
        Token = 'tokennnnnnnnnn'
        ID = 'iddddddddddd'
        url = 'https://api.telegram.org/bot' + Token + '/sendMessage?text=' + post + '&chat_id=' + ID 
        requests.get(url)
        
before_len=-1 


while True:
    timee = datetime.today().strftime('%Y%m%d')
    # print(timee)

    pyautogui.click(button='right',x=130 , y=317)
    pyautogui.click(172 , 330 )

    time.sleep(0.5)


    lines = []
    meta_path = 'C:/Users/Lapci.ir/AppData/Roaming/MetaQuotes/Terminal/
pathhhhhh /MQL5/Logs/'
    with open(meta_path+timee+'.log' ) as f:

        lines = f.readlines()
        len0=len(lines)-2
        print("all len >  ",len0)
        if before_len==-1 or before_len > len0: before_len=len0 
            
        if len0 >0 and len0 > before_len:
            for x in range(before_len, len0, 1):
                tttxt= lines[x]
                text0= tttxt.split("\t")
                print(text0)
                if len(text0) > 1:
                    #for x in range(2, len(text0), 1):

                    
                    text1= text0[2].encode().decode('utf-8')+text0[3].encode().decode('utf-8')+ text0[4].encode().decode('utf-8')
                    #TelegramBot(text1)

                    print("     if     ",x , "     ", text0[4])
                    before_len=x+1
                else:
                    #before_len=x
                    print("else     ",x)
                    #break
    time.sleep(3)




              
                
                

 

now I want the file to be updated without clicking
Language code does not matter

any idea can help🌹🌹🌹
 
gopok87350 #: how can i auto update expert log file when terminal is runing

You don't because of caching. Stop trying.

Reason: