Panel that does not minimize or stay on top of everything

 

Hello everybody!


I would like to know if it is possible to make a panel stay on top of each and every other graph window that is created,
In other words, it always stays on top of everything in the metatrader, or at least that when switching chart windows this panel does not minimize...

Below is an example of the base code I used to create this panel.

 #include <Controls\Dialog.mqh>

CAppDialog AppWindow;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create application dialog
   if(!AppWindow.Create(0,"AppWindow",0,20,20,360,324))
      return(INIT_FAILED);
//--- run application
   AppWindow.Run();
//--- succeed
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy dialog
   AppWindow.Destroy(reason);
  }
//+------------------------------------------------------------------+
//| Expert chart event function                                      |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,         // event ID  
                  const long& lparam,   // event parameter of the long type
                  const double& dparam, // event parameter of the double type
                  const string& sparam) // event parameter of the string type
  {
   AppWindow.ChartEvent(id,lparam,dparam,sparam);
  }
//+------------------------------------------------------------------+

Thank you in advance for your help from friends
Descubra novos recursos para o MetaTrader 5 com a comunidade e os serviços MQL5
Descubra novos recursos para o MetaTrader 5 com a comunidade e os serviços MQL5
  • 2024.03.27
  • www.mql5.com
MQL5: linguagem de estratégias de negociação inseridas no Terminal do Cliente MetaTrader 5. A linguagem permite escrever seus próprios sistemas automáticos de negócios, indicadores técnicos, scripts e bibliotecas de funções
 
MQL5.community - User Memo
MQL5.community - User Memo
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
Moniki Priscilla:

Hello everybody!


I would like to know if it is possible to make a panel stay on top of each and every other graph window that is created,
In other words, it always stays on top of everything in the metatrader, or at least that when switching chart windows this panel does not minimize...

Below is an example of the base code I used to create this panel.


Thank you in advance for your help from friends
It is possible to make a panel stay on top of all other chart windows in MT5.

However, the code you provided creates a dialog window, which is different from a panel.
 
Oleksandr Medviediev # :
É possível fazer com que um painel fique no topo de todas as outras janelas do gráfico no MT5.

No entanto, o código fornecido cria uma janela de diálogo diferente de um painel.

How would you recommend me to create this panel?

 
#include <Controls\WndClient.mqh>

CWndClient ExtPanel;

int OnInit()
  {
   if(!ExtPanel.Create(0,"ExtPanel",0,20,20,400,200))
      return(INIT_FAILED);

   ExtPanel.Detach();
   ExtPanel.SetZOrder(1); // Bring the panel to the top
   ExtPanel.Activate(); // Activate the panel to receive events
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   ExtPanel.Destroy();
  }

void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam)
  {
   ExtPanel.ChartEvent(id,lparam,dparam,sparam);
  }

With this code, the panel will stay on top of all chart windows.

Enjoy!

Reason: