Download MetaTrader 5

DLL and chart component flicker

To add comments, please log in or register
Phil
20
Phil 2015.04.18 11:36 

Hi 

I'm building a DLL for a EA I'm working on and part of it adds winform controls such as list boxes to the chart. This works just fine, however whenever there is an update to the chart it causes my added components to flicker.. I've searched high and low for a workaround/fix for this issue, but no luck.. I know there is the MT4GUI project which the developer has managed to get around it somehow, but unfortunately he's not keen to advise as he feels it could be a competitive product (even though it definitely isnt), but I completely understand his position.

Can anyone point me in the right direction?

 

Thanks all :) 

Phil
20
Phil 2015.04.18 12:55  
pconibere:

Hi 

I'm building a DLL for a EA I'm working on and part of it adds winform controls such as list boxes to the chart. This works just fine, however whenever there is an update to the chart it causes my added components to flicker.. I've searched high and low for a workaround/fix for this issue, but no luck.. I know there is the MT4GUI project which the developer has managed to get around it somehow, but unfortunately he's not keen to advise as he feels it could be a competitive product (even though it definitely isnt), but I completely understand his position.

Can anyone point me in the right direction?

 

Thanks all :) 

Figured it out finally. In the event anyone else has this same issue, the simple answer is to set the WS_CLIPCHILDREN style on the window handle passed to the DLL.

In C#, I've simply done this:

int existingStyle = GetWindowLong(handle, GWL_STYLE);

SetWindowLong(handle, GWL_STYLE, existingStyle | WS_CLIPCHILDREN);

Obviously there are supporting functions there, but if you've got this far you'll have those already.
To add comments, please log in or register