//import WM_消息.wcs 
SET  WM_SIZE=0x0005
SET SIZE_MAXHIDE=4
SET SIZE_MAXSHOW=3
SET SIZE_MAXIMIZED=2
SET SIZE_MINIMIZED=1
SET SIZE_RESTORED=0

_SUB WIN1,L100T300W350H180,PECMD%PECMDVER%自动调整大小-可变大小,,,,, -maxb -size 
    ENVI I=0
    MEMO E1,L10T10W324H125,1234,  
//244,155    
    ENVI @WIN1.MSG=%&WM_SIZE%::&&wParm,&&lParm,CALL OnSize_WIN1 %&wParm%  %&lParm% 
_END
call @WIN1

_SUB OnSize_WIN1
   TEAM ENVI &&sz=0| ENVI &&w=0| ENVI &&h=0
   IFEX $%1 = %&SIZE_MAXIMIZED%, ENVI &sz=1
   IFEX $%1 = %&SIZE_MAXSHOW%, ENVI &sz=1
   IFEX $%1 = %&SIZE_RESTORED%, ENVI &sz=1
//MESS wParm=[%1] [] sz=[%&sz%] @调试信息#OK
   IFEX $1=%&sz%,
   {
        ENVI &&LP=%2
        CALC #&w= %&LP% & 0xFFFF   //LOW
        CALC #&h= %&LP% / 0x10000  //HIGH
//MESS wParm=[%1] [%&w%,%&h%] sz=[%&sz%] @调试信息#OK

        CALC #&w= %&w% - 20
        CALC #&h= %&h% - 20
        
        ENVI @E1.POS=::%&w%:%&h%
   }
    
_END
