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
Do not use this library has it?
I tested the code is as follows:
//+------------------------------------------------------------------+
//| myTest.mq4 |
//| Copyright ?2008, MetaQuotes Software Corp. |
//| https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2008, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net/"
#import "IdleLib.dll"
int GetLastKeyWP();
int GetLastMouseWP();
int IdleLibInit();
int IdleLibUnInit();
string GetActiveWndName();
#import
bool error;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
error = false;
if ( IsDllsAllowed() )
IdleLibInit();
else
Alert("Error: Dll Don't Call!");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
if ( IsDllsAllowed() ) IdleLibUnInit();
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if ( error ) { return(-1); }
if ( IsDllsAllowed() ) vHandsTrade_CheckKey();
//----
return(0);
}
//+------------------------------------------------------------------+
void vHandsTrade_CheckKey()
{
static int pre_pressed = 0;
static int pre_time = 0;
int i, now_pressed = GetLastKeyWP();
string name, lastwnd = GetActiveWndName();
Comment( StringConcatenate( "check_key(): now_pressed = ", now_pressed, ", lastwnd = ", lastwnd ) );
if( now_pressed != 0 && lastwnd != "" )
{
Print("wnd:",lastwnd," key:",now_pressed);
}
}