IFEX %CurFile%.LOG, LOGS --2 *   %CurFile%.LOG
ENVI^  ForceLocal=1
SET  ::WM_SETTEXT=0x000C
SET  ::WM_GETTEXT=0x000D
SET  ::WM_GETTEXTLENGTH=0x000E

WIN1

_SUB WIN1,W287H286,进程间传递字符串演示,
    //ENVI @this.Visible=0
    LABE LABE1,L15T53W260H30,LABE1,,
    LABE LABE2,L15T93W260H30,LABE2,,  //接受方：接受消息的窗口，可以隐藏
    EDIT -vcenter EDIT1,L183T180W60H30,EDIT1,,  //发送方：接受消息的窗口句柄HWND

    ENVI @LABE1.ID=?WIDL1
    ENVI @LABE1=%WIDL1%
    ENVI @EDIT1=%WIDL1%
    ENVI @LABE1.MSG=_%&WM_SETTEXT%: OnSETTEXTL1 MESS [%LABE1%]
    ENVI @LABE1.MSG=#1: OnSETTEXTL2 MESS [%LABE1%]
    ITEM ITEM1,L106T182W60H30,发送,OnSEND,
_END
_SUB OnSETTEXTL1 
    SET &V2=
    GetWindowText  %WIDL1%  &V2
    ENVI @LABE2=%&V2%
    //MESS [%&V2%]
_END

//函数:  GetWindowText  窗口ID   文本变量名
_SUB GetWindowText
    //ENVI @@POS=%1:::::::1:1 //激活
    ENVI @@SENDMSG=:&&___LEN__;%1;%WM_GETTEXTLENGTH%;0;0 //长度
    CALC #&___LEN__=%&___LEN__% + 100
    ENVI$ %2=*%&___LEN__%  0   //申请内存/缓冲区
    ENVI @@SENDMSG=%1;%WM_GETTEXT%;%&___LEN__%;@%2
_END

_SUB OnSEND
    ENVI @@SENDMSG=%EDIT1%;%WM_SETTEXT%;0;$hello World %RANDOM%
_END
//测试
//PECMD ENVI @@SENDMSG=0x700D2;0x000C;0;$hello World %RANDOM%


