Download MetaTrader 5
To add comments, please log in or register
Order the development and track its status via your mobile phone.
Faltensack
14
Faltensack 2015.12.11 13:09 

Hello together,

when I press F11 I get a FullScreen of my Chart and if I press F11 the Chart gets small again. Is it possible to see in mql4 whether I have Fullscreen or not.

Regards

Falte

whroeder1
13641
whroeder1 2015.12.11 14:57  
Fullscreen = no tool bars
Faltensack
14
Faltensack 2015.12.11 16:22  
WHRoeder:
Fullscreen = no tool bars

Dear WHRoeder,


what do you mean with that comment? I try to find out in my mql4-Indicator if the chart window is Fullscreen or not (or in your words: is no tool bars or is tool bars). Is there an easy possibility to get this?

Regards

Klaus

whroeder1
13641
whroeder1 2015.12.12 12:51  
Faltensack: Is it possible to see in mql4 whether I have Fullscreen or not.
I answered your question on how you see. Indicator can't see and shouldn't need to know.
Ali Akcaagac
169
Ali Akcaagac 2015.12.12 14:05  

Actually there is a workaround or trick howto figure full screen (or full screen chart) if you wish.

I have this coming out of my mind:

  1. Use some Windows API to determine the Root Screen width and height. E.g. 1366 x 786
  2. Get the current Chart Window width and height size. E.g. 800 x 640
  3. Now 1366 != 800 and 786 != 640. Means the Windows API returned a higher screen resolution than what your Chart Window returns
  4. Knowing this, this tells you that your Chart Window IS NOT full screen
  5. Now if you press F11 (or the full screen menu option) then your Chart Window usually reaches close to 1366 x 768 in width and height
  6. So even if your Chart Window goes to 1350 x 755 then it's close to 1366 x 768 (you can add a threshold because the borders of your window decoration (or theme) needs to be subtracted). This can be used as some sort of IS FULL screen

In pseudo code, this would look like this:

int screenWidth = WindowsAPIGetScreenWidth();
int screenHeight = WindowsAPIGetScreenHeight();
int chartWidth = MQ4APIGetChartWidth();
int chartHeight = MQ4APIGetChartHeight();

boolean isFullScreen(int screenWidth, int screenHeight, int chartWidth, int chartHeight) {
  // threshold for width
  if ((chartWidth + 50) >= screenWidth) {
    chartWidth = screenWdith;
  }

  // threshold for height
  if ((chartHeight + 50) >= screenHeight) {
    chartHeight = screenHeight;
  }

  // do we believe it's full screen ? return true !
  if (screenWidth >= chartWidth && screenHeight >= chartHeight) {
    return true;
  }

  // do we believe it's NOT full screen ? return false !
  return false;
}

 

Faltensack
14
Faltensack 2015.12.29 10:45  
aakcaagac:

Actually there is a workaround or trick howto figure full screen (or full screen chart) if you wish.

I have this coming out of my mind:

  1. Use some Windows API to determine the Root Screen width and height. E.g. 1366 x 786
  2. Get the current Chart Window width and height size. E.g. 800 x 640
  3. Now 1366 != 800 and 786 != 640. Means the Windows API returned a higher screen resolution than what your Chart Window returns
  4. Knowing this, this tells you that your Chart Window IS NOT full screen
  5. Now if you press F11 (or the full screen menu option) then your Chart Window usually reaches close to 1366 x 768 in width and height
  6. So even if your Chart Window goes to 1350 x 755 then it's close to 1366 x 768 (you can add a threshold because the borders of your window decoration (or theme) needs to be subtracted). This can be used as some sort of IS FULL screen

In pseudo code, this would look like this:

 

Thank you for your help Akcaagac. That was exactly what I was looking for!

/
To add comments, please log in or register