Download MetaTrader 5

renaming MT4 label at top of window

To add comments, please log in or register
rp22rp22rp22
21
rp22rp22rp22  

is there a way to rename the label at the top left hand corner of MT4?

I'm trying to shorten it so that another program can recognize it.

So instead of saying 274530 Oanda Meta trader Account EURUSD

IT WOULD SAY 274530 Oanda Meta trader Account

If so, please guide me on how to do it.

Thanks

rick

qjol
3243
qjol  
Ex Ovo Omnia
3381
Ex Ovo Omnia  

This would work. You need to adopt the import declaration (I do not share everything)

#include <Ovo/imports/constants.import.mqh>
#import "user32.dll"
BOOL WINAPI SetWindowTextW(
  _In_      HWND hWnd,
  _In_opt_  LPCTSTR lpString
);
HWND WINAPI GetParent(
  _In_  HWND hWnd
);
#import

void OnStart() {
   string text = "My label";
   SetWindowTextW(GetParent(GetParent(GetParent((int)ChartGetInteger(0, CHART_WINDOW_HANDLE)))), text);
}
qjol
3243
qjol  
@Ovo why use GetParenGetParentGetParentGetParentGetParent.... instead of GetAncestor
Ex Ovo Omnia
3381
Ex Ovo Omnia  
qjol:
@Ovo why use GetParenGetParentGetParentGetParentGetParent.... instead of GetAncestor
For sure you may use whatever you prefer. Perhaps there are some other ways.
To add comments, please log in or register