How to Hide symbol chart's Caption and Border in MT5?

hosseinimtrader  
Hi guys...
How to Hide symbol chart's Caption and Border? Just like the picture...

https://c.mql5.com/3/393/image.jpg

I have tried below code from Mr. rrocchi for MT4 and it works very well:
//+------------------------------------------------------------------+
//|                                                 RemoveBorder.mq4 |
//|                         Copyright 2018-2019, Rafael Prado Rocchi |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018-2019, Rafael Prado Rocchi"
#property link      "https://www.mql5.com/en/users/rrocchi"

#property indicator_chart_window


extern int win1 = 1;
extern int Adjust_Side_to_side = 0;
extern int Shift_UP_DN = 0;

#import "user32.dll"
  int SetWindowLongA(int hWnd,int nIndex, int dwNewLong);
  int GetWindowLongA(int hWnd,int nIndex);
  int SetWindowPos(int hWnd, int hWndInsertAfter,int X, int Y, int cx, int cy, int uFlags);
  int GetParent(int hWnd);
#import


#define GWL_STYLE         -16 
#define WS_CAPTION        0x00C00000 
#define WS_DLGFRAME       0x00400000
#define SWP_NOSIZE        0x0001
#define SWP_NOMOVE        0x0002
#define SWP_NOZORDER      0x0004
#define SWP_NOACTIVATE    0x0010
#define SWP_FRAMECHANGED  0x0020
#define SWP_NOSENDCHANGING 0x0400
#define SWP_SHOWWINDOW     0x0040
#define SWP_NOREPOSITION   0x0200
#define WS_TILED           0x00000000


#define janela_inferior 1
int ticks=0;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init() {
    
   IndicatorShortName(" ");
  
   int iChartParent=GetParent(WindowHandle(Symbol(),0));    
   int iNewStyle = GetWindowLongA(iChartParent, GWL_STYLE) & (~WS_CAPTION);    
   if (iChartParent>0 && iNewStyle>0) {
       SetWindowLongA(iChartParent, GWL_STYLE, iNewStyle);
       SetWindowPos(iChartParent,0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSENDCHANGING|SWP_SHOWWINDOW|SWP_NOREPOSITION);
   }
    
  return(0);
}

//+-------------------------------------+
//| Deinit                              |
//+-------------------------------------+
void OnDeinit(const int reason) {
   return; 
}
 

void start() {
   return;
}



//+------------------------------------------------------------------+



I have tried to convert the code to MQ5 Version but didn't run. I try so many combination of this but still didn't work.

I try this code and many others!

#include <Charts\Chart.mqh>

#import "user32.dll"
  int SetWindowLongA(int hWnd,int nIndex, int dwNewLong);
  int GetWindowLongA(int hWnd,int nIndex);
  int SetWindowPos(int hWnd, int hWndInsertAfter,int X, int Y, int cx, int cy, int uFlags);
  int GetParent(int hWnd); 
#import


#define GWL_STYLE         -16 
#define WS_CAPTION        0x00C00000 
#define SWP_NOSIZE        0x0001
#define SWP_NOMOVE        0x0002
#define SWP_NOZORDER      0x0004
#define SWP_NOACTIVATE    0x0010
#define SWP_FRAMECHANGED  0x0020


CChart cChart;

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---

   cChart.Attach();
   
   int iChartParent = GetParent(cChart.WindowHandle());
   
   cChart.Detach();
      
   int iNewStyle = GetWindowLongA(iChartParent, GWL_STYLE) & (~WS_CAPTION); 
   
         
   if (iChartParent>0 && iNewStyle>0) {
    SetWindowLongA(iChartParent, GWL_STYLE, iNewStyle);
    
    SetWindowPos(iChartParent,0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE| SWP_FRAMECHANGED);
    
   }             
   
  }



Can you help me to solve this case...

thanks before...
image
image
  • Freeimage.host
  • freeimage.host
Image image hosted in Freeimage.host
Files:
image.jpg  92 kb
hosseinimtrader  
Does anyone have any suggestions about this, please?
Thanks...
Aleksandr Mironov  
hosseinimtrader #:
Does anyone have any suggestions about this, please?
Thanks...

Hi. Can you share if there is a solution?

Reason: