How can I get windows handle of currently active(focused) chart?

Back to topics list To post a new topic, please log in or register
avatar
12
kjaved 2015.08.28 05: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?
avatar
126
Demos 2015.08.29 14: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://forum.mql4.com/47991 

 

best regards 

avatar
1752
avatar
12
kjaved 2015.09.02 17: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.
avatar
145
aakcaagac 2015.09.02 18: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.
avatar
125
zirkoner 2015.09.02 18: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.

Back to topics list  

To add comments, please log in or register