Download MetaTrader 5
To add comments, please log in or register
Share links from other resources. Now they have a description.
rp22rp22rp22
21
rp22rp22rp22 2014.04.18 01:04 

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 2014.04.18 01:31  
Ovo Cz
2987
Ovo Cz 2014.04.18 05:33  

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 2014.04.18 06:23  
@Ovo why use GetParenGetParentGetParentGetParentGetParent.... instead of GetAncestor
Ovo Cz
2987
Ovo Cz 2014.04.18 07:15  
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