You'll want to be using PostMessageW (not PostMessageA) - a change from ansi to unicode came in with build 600.
honest_knave:
Thanks but that is for posting messages to the thread and I want to get info from a child window.
You'll want to be using PostMessageW (not PostMessageA) - a change from ansi to unicode came in with build 600.
strontiumDog:
Thanks but that is for posting messages to the thread and I want to get info from a child window.
Thanks but that is for posting messages to the thread and I want to get info from a child window.
TBH I'm a little confused why you would even be bothering with a DLL when you have ChartApplyTemplate()
void OnStart() { long chart_id=ChartFirst(); while(chart_id >= 0) { if(ChartSymbol(chart_id) != "XAUUSD") ChartApplyTemplate(chart_id,"ADX.tpl"); chart_id = ChartNext(chart_id); } }
Edit:
strontiumDog:
as I reckon it's a 1-liner that will be quick to comment on.
OK, in one line then
for(long i=ChartFirst(); i>=0; i=ChartNext(i)) if(ChartSymbol(i) != "XAUUSD") ChartApplyTemplate(i,"ADX.tpl");


ChartApplyTemplate - Chart Operations - MQL4 Reference
- docs.mql4.com
ChartApplyTemplate - Chart Operations - MQL4 Reference
honest_knave:
Thanks! The reason I'd not done this is that I had the old script around since before ChartApplyTemplate() was available.
TBH I'm a little confused why you would even be bothering with a DLL when you have ChartApplyTemplate()
Edit:
OK, in one line then
strontiumDog:
Thanks! The reason I'd not done this is that I had the old script around since before ChartApplyTemplate() was available.
Thanks! The reason I'd not done this is that I had the old script around since before ChartApplyTemplate() was available.
I did wonder that when I saw the date on the code - I'm glad you got it sorted.
Fortunately there have been plenty of new features added over the years.

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
Hello
I have this script which works great, and changes *all* my charts to a selected template. But I have various fx pairs and oil and gold, and I don't want the template change to affect the oil and gold as I have different templates for them, so I have to keep changing them after running the script.
I have played at length with it, and yet find this user32 work impenetrable; I'm not from a Windows programming background.
From experience, I'm thinking there is probably only a small change to make but everything I try, fails. Even print statements aren't always printed (I've looked in the logs, not just the terminal to check this). And when it does print/alert, Symbol appears null.
Can anyone tell me where I might need to change this to ignore ChartSymbol() == "XAUUSD" etc please? I'm sensitive to asking people to write code for me, and only doing this as I reckon it's a 1-liner that will be quick to comment on. A link to a forum post will do, but I've failed to find one thus far. Thanks IA