用批处理也能做大事,借助pmos这个强大的鼠标第三方,批处理也能实现wpf那种分类菜单。以下只是个举例,可以实现非常复杂的动态菜单效果,完全借助鼠标的浮动,无需点击。开启批处理菜单新时代。
演示文件下载链接: https://pan.baidu.com/s/1EWQAerFOb4LslvS271rHLg?pwd=mwb5- @echo off&setlocal enabledelayedexpansion
- mode con cols=80 lines=25
- ::*************************************
- REM 设置菜单宽高
- set WITH=116
- set HIGH=33
- REM 开启画质增强
- set F1=1
- ::*************************************
-
- :MENU
- echo __________________
- echo ^| 1区域 ^|
- echo ^|__________________^|
- echo;
- echo;
- echo __________________
- echo ^| 2区域 ^|
- echo ^|__________________^|
- echo;
- echo;
- echo __________________
- echo ^| 3区域 ^|
- echo ^|__________________^|
- goto :MAIN
-
- :MENU1
- echo __________________ ________________
- echo ^| 1区域 ^| ==^> ^|^>^>^> ^|
- echo ^|__________________^| ^| 1.1西红柿 ^|
- echo ^| 1.2黄瓜 ^|
- echo ^| 1.3白菜 ^|
- echo __________________ ^|________________^|
- echo ^| 2区域 ^|
- echo ^|__________________^|
- echo;
- echo;
- echo __________________
- echo ^| 3区域 ^|
- echo ^|__________________^|
- goto :EOF
-
- :MENU2
- echo __________________
- echo ^| 1区域 ^|
- echo ^|__________________^|
- echo;
- echo;
- echo __________________ ________________
- echo ^| 2区域 ^| ==^> ^|^>^>^> ^|
- echo ^|__________________^| ^| 2.1鱼肉 ^|
- echo ^| 2.2熊掌肉 ^|
- echo ^| 2.3鸭肉 ^|
- echo __________________ ^|________________^|
- echo ^| 3区域 ^|
- echo ^|__________________^|
- goto :EOF
-
- :MENU3
- echo __________________
- echo ^| 1区域 ^|
- echo ^|__________________^|
- echo;
- echo;
- echo __________________
- echo ^| 2区域 ^|
- echo ^|__________________^| ________________
- echo ^|^>^>^> ^|
- echo ^| 3.1苹果 ^|
- echo __________________ ^| 3.2水蜜桃 ^|
- echo ^| 3区域 ^| ==^> ^| 3.3橙子 ^|
- echo ^|__________________^| ^|________________^|
- goto :EOF
-
- :MAIN
- for /l %%N in (1,1,300 ) do (
- set "SPACE=!SPACE!"
- )
-
- for /l %%a in () do (
-
- pmos /f 15,17,%WITH%,%HIGH% 15,94,%WITH%,%HIGH% 15,176,%WITH%,%HIGH%
-
- set NowErrorlevel=!errorlevel!
- title 鼠标在!NowErrorlevel!区域
-
- if !PreErrorlevel! neq !NowErrorlevel! (
-
- set PreErrorlevel=!NowErrorlevel!
-
- if !F1! equ 1 (
- 2>NUL echo !SPACE!&set/p=<NUL
- ) else (
- cls
- )
-
- call :MENU!NowErrorlevel!
- )
- )
复制代码
|