You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The code checks only Russian and English languages
If someone gives the name of the Start button in other languages, I will include it in the source.
For Chinese, the text of the "Start" and "Stop" buttons is as follows: "开始" and "停止".
Updated.
Wouldn't it be easier to read a string from the button and then compare whether it remains the same or has changed?
After all, the function should not be dependent on previous states. It would be easier to use colour: green - start, otherwise - stop. But I do everything in WinAPI by poke method, so I don't know how to read the colour (Green component) of the button. If there is a working variant, of course, I will replace it.
Still, the function should not be dependent on previous states. It would be easier to use colour: green - start, otherwise - stop. But I do everything in WinAPI by poke method, so I don't know how to read the colour (Green component) of the button. If there is a working variant, of course, I will replace it.
This code has been tested by me and it is confirmed that it works.
(I recommend you to keep both methods, maybe in the future MT5 developers will change the colours).
Still, the function should not be dependent on previous states. It would be easier to use colour: green - start, otherwise - stop. But I do everything in WinAPI by poke method, so I don't know how to read the colour (Green component) of the button. If there is a working variant, of course, I will replace it.
It is probably easier not by the colour of the button, but by the status of the Inputs list - enabled/disabled.
Where to get the status of Inputs? There is no official API, we have to determine it by colours and text.
Well, there is no official API for all MT5 internals - you have to inspect them through utilities like MS Spy - that's how the control identifiers were found, which are now used in the multitester.
If you don't go into the wilds of Inputs and just use the already tested start button, it seems that the GetWindowLongW(hwnd, 0) call should return the current colour of the button. Mine returns 0xD0B1DF10 for the green one. Only if MQ decides to correct the style, this setting might go away. So checking the activity of Inputs is more reliable anyway.
looks like the GetWindowLongW(hwnd, 0) call should return the current colour of the button. I get 0xD0B1DF10 for the green one.