请问 IdleLib.dll 已经失效了么?

 

下载了 IdleLib.dll 拦按键信息,

但是没有任何信息出现,

难道这个库已经不能使用了?

我的测试代码如下:

//+------------------------------------------------------------------+
//| 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);
}

}

原因: