anyone an idea? For whatever reason, the corresponding - ChartGetInteger(m_chart_id,CHART_WINDOW_HANDLE) - returns zero.
I know. The question is how, which functions of winuser32.dll lead to the result?
Because of the many irregularities in MQL the logic differs depending on what MQL program type you call the function from. So it is different for experts, indicators and scripts.
Have a look at my code here: https://github.com/rosasurfer/mt4-expander/blob/master/src/context.cpp#L539
The function resolves the HWND of the current chart under all possible circumstances (also when WindowHandle() returns 0). Some comments are still in German but you should get the logic and already know the used functions. If it matches your skill level I can extract and simplify it a bit and write a WindowHandleEx() for you.
Then, this is MT4 not MT5. If you need the same for MT5 it will be similar but not the same. In this case I can't help, sorry.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.