TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1

SET &WM_COMMAND=0x0111
SET &EN_CHANGE=0x0300

CALL @WIN1
_SUB WIN1,W510H280,虚拟内存与临时文件设置,SET bt=,
    SET-def bt=1
    SET-def BOOT_Enable=1
    SET-def Title0=%WIN1% 
    LABE -center -vcenter LABE1,L12T108W55H18,确定目录:,,
    FDIR --fullfile &&BOOT=%&CurDir%\..
    EDIT TMPDir,L67T105W140H20,%&BOOT%,,0x100
    ITEM BOOTDIR,L210T103W50H24,浏览,CALl SelectBOOT,

    SET &WM_COMMAND=0x0111
    SET &EN_CHANGE=0x0300
    ENVI @TMPDir.ID=?;&&TMPDir_ID
    CALC -base=16 #&&TMPDir_CHANGE=%&EN_CHANGE% * 0x10000  + %TMPDir_ID%   //低16位，控件ID   //高16位,操作码

    LABE -center -vcenter LABE2,L12T138W55H18,确定文件:,,
    SET-def Fileimg_Enable=2
    EDIT Fileimg,L67T135W140H20,%Fileimg%,,0x100
    ITEM BOOTFile,L210T133W50H24,浏览,CALl SelectFile,

    SET &WM_COMMAND=0x0111
    SET &EN_CHANGE=0x0300
    ENVI @Fileimg.ID=?;&Fileimg_ID
    CALC -base=16 #&Fileimg_CHANGE=%&EN_CHANGE% * 0x10000  + %Fileimg_ID%   //低16位，控件ID   //高16位,操作码
    ENVI @this.MSG=_%&WM_COMMAND%::&&wp,&&lp,CALL OnCommand   //捕捉内容改变,大家公用的。里面再分。
    CALL OnTimer1
_END
    
_SUB OnCommand 
	FIND $1=%bt%,! EXIT
	IFEX $%TMPDir_CHANGE%=%&wp%, CALL OnTMPDir    //这里监视多个  [1]
	IFEX $%Fileimg_CHANGE%=%&wp%,CALL OnFileimg  //这里监视多个  [2]
_END

_SUB OnTMPDir   //监控 TMPDir
    ENVI @this=%Title0% OnTMPDir [%TMPDir%]  
_END

_SUB OnFileimg  //监控 Fileimg
    ENVI @this=%Title0% OnFileimg  [%Fileimg%]  
_END 
   