Why the Windows API can't work properly?
MQL string type is in Unicode format. So you may have a try to use "FindWindowW" instead of "FindWindowA".
However, I didn't try it :)
My code is:
--------------------------------------------------------------------------
<CODE DELETED>
--------------------------------------------------------------------------
Compiling and running are correct,but the result is:
Receive window Calculator is not found!
RcvWndHdl=0
---------------------------------------------------------------------------
My purpose is that send data to external window of other program.
My code is:
--------------------------------------------------------------------------
#include <WinUser32.mqh>
#property indicator_chart_window
extern string RcvWndCaption="Calculator";
int RcvWndHdl;//Receive window handle
int init()
{
//Seek the receive window and get its handle
RcvWndHdl=FindWindowA("",RcvWndCaption);
if (RcvWndHdl>0)
Print(" Receive window ",RcvWndCaption," is found!");
else
Print(" Receive window ",RcvWndCaption," is not found!");
Print("RcvWndHdl=",RcvWndHdl);
return(0);
}
--------------------------------------------------------------------------
Compiling and running are correct,but the result is:
Receive window Calculator is not found!
RcvWndHdl=0
---------------------------------------------------------------------------
My purpose is that send data to external window of other program.