Hi folks,
I hope you find the tool of today a useful one.
Our tool today is how to send keyboard strokes to MetaTrader from your MQL4 code.
For example: You want to open the Option window from your script (CTRL+O). You want to shutdown MetaTrader (ALT+F4).
Or you maybe want to run an expert advisor or another script from your code by assigning a hotkey to that program and call it from our tool.
The scenarios are unlimited!
Our script has two only functions:
Use this function to send a key stroke to MetaTrader.
The first parameter is the key you want to send. You will find the list of all the keyboard keys in the top of the script.
The second parameter is an optional one. And you set it to true if you want to send the key and release it immediately.
Releasing the key is very important. Just imagine you have clicked the CTRL key and didn't release it. Every keystroke after that will be combined with CTRL key. So, don't forget to release every key you have sent.
Use this function to release the key you have sent if you didn't release it already using the second parameter of SendKey.
I hope you enjoy the tool and I'm waiting the scenarios you used the tool in.
Coder Guru
www.xpworx.com