修改了全屏切换显示代码
主要是对注册表的对应键值进行了现场保护
同时使用start加标题切换显示模式上更为简单和灵活
也不影响批处理自身命令行参数的分析
@echo off & setlocal
if "%ShowMode%"=="FullScreen" goto :FullScreen
if "%ShowMode%"=="WindowMode" goto :WindowMode
REG Add HKCU\Console\FullScreen /v FullScreen /t REG_DWORD /d 1 /f>nul
REG Add HKCU\Console\WindowMode /v FullScreen /t REG_DWORD /d 0 /f>nul
set InitMode=true
echo 演示即将开始,首先将进入全屏模式
pause
set ShowMode=FullScreen
start "FullScreen" %0 %*
goto :end
:FullScreen
echo 这是在全屏显示模式下工作
echo Working in full screen mode.
echo 现在将返回普通窗口模式
pause
set ShowMode=WindowMode
start "WindowMode" %0 %*
goto :end
:WindowMode
echo 这是在窗口显示模式下工作
echo Working in normal window mode.
echo 显示结束,即将退出
pause
goto :end
:end
REG delete HKCU\Console\FullScreen /f>nul
REG delete HKCU\Console\WindowMode /f>nul
exit
Modified the full-screen switching display code. Mainly, the corresponding key values in the registry were protected on-site. At the same time, using start with a title to switch the display mode is simpler and more flexible, and it does not affect the analysis of the batch processing itself command line parameters.
@echo off & setlocal
if "%ShowMode%"=="FullScreen" goto :FullScreen
if "%ShowMode%"=="WindowMode" goto :WindowMode
REG Add HKCU\Console\FullScreen /v FullScreen /t REG_DWORD /d 1 /f>nul
REG Add HKCU\Console\WindowMode /v FullScreen /t REG_DWORD /d 0 /f>nul
set InitMode=true
echo The demonstration is about to begin, first it will enter full screen mode
pause
set ShowMode=FullScreen
start "FullScreen" %0 %*
goto :end
:FullScreen
echo This is working in full screen display mode
echo Working in full screen mode.
echo Now it will return to normal window mode
pause
set ShowMode=WindowMode
start "WindowMode" %0 %*
goto :end
:WindowMode
echo This is working in window display mode
echo Working in normal window mode.
echo Display ends, about to exit
pause
goto :end
:end
REG delete HKCU\Console\FullScreen /f>nul
REG delete HKCU\Console\WindowMode /f>nul
exit