Download MetaTrader 5
To add comments, please log in or register
Sell products via the Market and track your sales statistics
Kashif Javed
824
Kashif Javed 2015.08.28 03:28 
Let suppose that 2 terminals are running in my system and each terminal has few opened charts. My question is that if there is any way to get the window handle of the chart which is currently active using any mql function or system DLL?
Demos Stogios
184
Demos Stogios 2015.08.29 12:48  

If you want the current chart, there is the function WindowHandle() from MQL and you may find some other, probably usefull functions in the "Chart Operations" part in the documentation. But I am confused if you want to know also which of the two terminals is active in your machine; in that case, that topic may help you to some extent https://www.mql5.com/en/forum/139341 

 

best regards 

okwh
1629
okwh 2015.08.29 14:47  
Kashif Javed
824
Kashif Javed 2015.09.02 15:55  
I know about WindowHandle() but I asked that I want to know Handle for currently focused/Active chart. WindowHandle() returns only chart handle in which EA is running. Let suppose that I clicks on EURUSD chart window that means now EURUSD chart is focused window . Now I need a function which can tell me Handle for this EURUSD chart.
Ali Akcaagac
169
Ali Akcaagac 2015.09.02 16:12  
Go here grab "boost_2.mq4" and look at the function IsTopWindow at the bottom. The function does exactly what you are asking for. Testing for the active Window.
Zirkon
123
Zirkon 2015.09.02 16:16  
kjaved8:
I know about WindowHandle() but I asked that I want to know Handle for currently focused/Active chart. WindowHandle() returns only chart handle in which EA is running. Let suppose that I clicks on EURUSD chart window that means now EURUSD chart is focused window . Now I need a function which can tell me Handle for this EURUSD chart.

There is no function to know which chart/window is active on mql4 (unless you run a custom code on each window), so you need to use WINAPI. Check the documentation.

/
To add comments, please log in or register