M大的PECMD里面示例就有
动态进度条文本.wcs
- // =================== 以下是你的示例代码 ==============================
- // 动态进度条+文本:
- IFEX X.LOG, LOGS * X.LOG
- CALL @&WIN1
- _SUB &WIN1,W303H192,执行.进度条,
- SET &p=0
- SET &V=
- PBAR PBAR1,L12T13W249H17,0
- LABE -center -vcenter -trans -ncmd PBAR1_TEXT,L11T42W251H18,,,0x0000FF
- ITEM ITEM1,L100T100W60H30,执行,CALL OnDo,
- _END
- _SUB OnDo
- SET &p=-1
- ENVI @ITEM1.Enable=0
- EXEC* --cmd::200:OnMsg &V=!cmd /c percentage.cmd //200ms
- ENVI @ITEM1.Enable=1
- _END
- _SUB OnMsg
- SET &p0=%&p%
- MSTR &p=<-2>-200 -200 %&V%END //倒数第2行
- CALC #&p=%p%
- IFEX %&p% < 0, EXIT -
- IFEX $%&p% == %&p0%, EXIT -
- ENVI @PBAR1=%&p%;%&p%%%
- ENVI @PBAR1_TEXT=%&p%
- _END
复制代码
percentage.cmd
- @ECHO OFF
- FOR /L %%i IN ( 0,10,100) DO ECHO %%i & ping -n 2 127.0.0.1>NUL
复制代码 |