Using ConsExt.exe (author QQ: 378246800) to create a batch processing interface is very simple. It supports the mouse, various different colors, and the code is very simple.
ConsExt Graphical Interface and Mouse Coordinate Acquisition Application Demonstration.bat
:KK
@echo off
start "NewThread" /b ConsExt.exe /showtime 61 0 0 10 8 "Local time: "
color 0B
@title Computer System Maintenance Edited by Wangwei QQ: 251485609 %date% %zcb%
:KSY
cls
@echo Demo Version System Maintenance Menu:
@echo. ╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
@echo ┃ 1 Clear Residual Junk Files (Modified Version) 2 Clear Malicious Programs (360 Security Guard) ┃
@echo. ┃ ┃
@echo ┃ 3 Set (Cancel) Software "Firewall" Restriction to Prevent Virus Startup (Prevent or Reduce Virus Infection) ┃
@echo. ┃ ┃
@echo ┃ 4 Exe, dll, inf Program Snapshot Comparison (Check if Modified by Virus) ┃
@echo. ┃ ┃
@echo ┃ 5 View Files Generated on or After a Certain Day (Default All Dates and All Files) ┃
@echo. ┃ ┃
@echo ┃ 6 File or System Backup (Restore) 7 Driver Program Backup (Installation) ┃
@echo. ┃ ┃
@echo ┃ 8 Install (Uninstall) One-click GHOST Backup 9 Install Shadow System (替身) ┃
@echo. ┃ ┃
@echo ┃10 Arbitrarily Create System Restore Point 11 Search and Automatically Delete Files According to List ┃
@echo. ┃ ┃
@echo ┃12 Current Running Program Information (Including Search for a Certain DLL) 13 Check Valid Links in Favorites ┃
@echo. ┃ ┃
@echo ┃18 Set (Remove) Full Attributes of Specified Files 19 System Hide and Lock (Unlock) ┃
@echo. ┃ ┃
@echo ┃23 File Encryption, Decryption, and Change Check Class 34 Security Assistant Tool SREng ┃
@echo. ┃ ┃
@echo ┃35 View Registered dll ocx exe Components 36 Network Setting Backup Port Class ┃
@echo ╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
ConsExt /fillrect 3 1 74 23 1 15
set ceo=ConsExt /echo
%ceo% 73 23 11 13 "Next Page"
:: Get mouse coordinates
ConsExt /event
set /a sbs=%errorlevel%+1
set mX=%sbs:~0,-3%
set mY=%sbs:~-2,2%
@echo Coordinates (X %mX%, Y %mY% )
set wX=X%mX%
set wY=Y%mY%
@echo Mouse %wX% %wY%
:: Mouse coordinate judgment
if %sbs% EQU 14 goto KK
if %mX% LSS 35 if %mY%==03 @echo 1
if %mX% GTR 45 if %mY%==03 @echo 2
if %mX% LSS 60 if %mY%==05 @echo 3
if %mX% LSS 55 if %mY%==07 @echo 4
if %mX% LSS 57 if %mY%==09 @echo 5
if %mX% LSS 35 if %mY%==11 @echo 6
if %mX% GTR 45 if %mY%==11 @echo 7
if %mX% LSS 35 if %mY%==13 @echo 8
if %mX% GTR 45 if %mY%==13 @echo 9
if %mX% LSS 35 if %mY%==15 @echo 10
if %mX% GTR 45 if %mY%==15 @echo 11
if %mX% LSS 35 if %mY%==17 @echo 12
if %mX% GTR 45 if %mY%==17 @echo 13
if %mX% LSS 35 if %mY%==19 @echo 18
if %mX% GTR 45 if %mY%==19 @echo 19
if %mX% LSS 35 if %mY%==21 @echo 23
if %mX% GTR 45 if %mY%==21 @echo 34
if %mX% LSS 35 if %mY%==23 @echo 35
if %mX% GTR 45 if %mY%==23 @echo 36
if %mX% GTR 73 if %mY%==24 goto KXY
ping/n 3 127.1>nul>NUL
goto kk
:KXY
@echo off
CLS
@echo. ╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
@echo ┃ 24 System Default Sharing (LAN Sharing Settings) 26 Modify TTL Value to Avoid Hacker Attack ┃
@echo. ┃ ┃
@echo ┃ 27 Favorites Backup or Restore (D:\) 28 View or Set System Startup Items ┃
@echo. ┃ ┃
@echo ┃ 29 Current Running Program Information SJ National Time Service Center Time (Calibration) ┃
@echo. ┃ ┃
@echo ┃ JD Delete Shortcut Arrows or Restore KX Quickly Terminate Processes Other Than Specified ┃
@echo. ┃ ┃
@echo ┃ KJ Network Free Space (Upload and Download) ARP LAN ARP Trojan Check ┃
@echo. ┃ ┃
@echo ┃ 14 Find Suspicious Programs 15 Force Terminate Suspicious Processes 16 Universal Software Extraction ┃
@echo. ┃ ┃
@echo ┃ 30 Enter Event Viewer 31 Anti-Delete Tool 32 Microsoft Security Scan ┃
@echo. ┃ ┃
@echo ┃ 33 Program Activity Information View 37 Obtain Computer Information 38 Registry Snapshot Comparison┃
@echo. ┃ ┃
@echo ┃ 39 Abnormal Folder Directory 17 Kill King 20 System Repair ┃
@echo. ┃ ┃
@echo ┃ bat View bat to exe Source Code 21 IE Repair 22 Registry Class 25 System Service Class ┃
@echo. ┃ ┃
@echo ┃ yy Entertainment (Human-Machine Battle Game) ZY LAN Sharing Resource Scan 40 Other ┃
@echo ╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
@echo Original Demo
ConsExt /fillrect 2 0 76 23 1 15
::set ceo=ConsExt /echo
%ceo% 73 23 11 13 "Previous Page"
:: Get mouse coordinates
ConsExt /event
set /a sbs=%errorlevel%+1
set mX=%sbs:~0,-3%
set mY=%sbs:~-2,2%
@echo Coordinates (X %mX%, Y %mY% )
:: Mouse coordinate judgment
if %sbs% EQU 14 goto KXY
if %mX% LSS 35 if %mY%==02 @echo 24
if %mX% GTR 45 if %mY%==02 @echo 26
if %mX% LSS 35 if %mY%==04 @echo 27
if %mX% GTR 45 if %mY%==04 @echo 28
if %mX% LSS 35 if %mY%==06 @echo 29
if %mX% GTR 45 if %mY%==06 @echo SJ
if %mX% LSS 35 if %mY%==08 @echo JD
if %mX% GTR 45 if %mY%==08 @echo KX
if %mX% LSS 35 if %mY%==10 @echo KJ
if %mX% GTR 45 if %mY%==10 @echo ARP
if %mX% LSS 25 if %mY%==12 @echo 14
if %mX% LSS 50 if %mX% GTR 35 if %mY%==12 @echo 15
if %mX% GTR 57 if %mY%==12 @echo 16
if %mX% LSS 25 if %mX% GTR 3 if %mY%==14 @echo 30
if %mX% LSS 50 if %mX% GTR 35 if %mY%==14 @echo 31
if %mX% GTR 57 if %mY%==14 @echo 32
if %mX% LSS 25 if %mY%==16 @echo 33
if %mX% LSS 50 if %mX% GTR 35 if %mY%==16 @echo 37
if %mX% GTR 57 if %mY%==16 @echo 38
if %mX% LSS 25 if %mY%==18 @echo 39
if %mX% LSS 50 if %mX% GTR 35 if %mY%==18 @echo 17
if %mX% GTR 57 if %mY%==18 @echo 20
if %mX% LSS 25 if %mY%==20 @echo bat
if %mX% LSS 40 if %mX% GTR 31 if %mY%==20 @echo 21
if %mX% LSS 54 if %mX% GTR 45 if %mY%==20 @echo 22
if %mX% GTR 57 if %mY%==20 @echo 25
if %mX% LSS 25 if %mY%==22 @echo yy
if %mX% LSS 50 if %mX% GTR 35 if %mY%==22 @echo ZY
if %mX% GTR 57 if %mY%==22 @echo 40
if %mX% GTR 50 if %mX% LSS 57 if %mY%==24 goto jxys
if %mX% GTR 73 if %mY%==24 goto KK
ping/n 1 127.1>nul>NUL
goto KXY
-----------------------------------------------------------------------------------
:jxys
::Original Demo
@echo off
setlocal ENABLEDELAYEDEXPANSION
echo The following will demonstrate the usage of ConsExt.
echo You can directly run ConsExt.exe to view the usage, or enter ConsExt /? in Cmd.
echo.
pause
cls
echo First, output a line of characters:
echo ConsExt /echo x coordinate y coordinate background color text color text to display [string width] [alignment]
echo.
echo Example: ConsExt /echo 3 2 11 13 "I love you!"
echo Press any key to start displaying...
pause>nul
ConsExt /echo 3 2 11 13 "I love you!"
echo.
echo Did you see it? What, didn't see it?
echo Well, if you're not lying, then there's a problem with ConsExt. Please contact the author to report the problem.
echo If there are any problems with the following demonstrations, please contact the author. QQ: 378246800. Thank you.
echo.
pause
cls
echo Display another window:
echo ConsExt /window x coordinate y coordinate width height background color [title] [left character of top line] [middle character of top line] [right character of top line] [left character of middle line] [middle character of middle line] [right character of middle line] [left character of bottom line] [middle character of bottom line] [right character of bottom line] [left character of separator line] [middle character of separator line] [right character of separator line]
echo.
echo Example: ConsExt /window 5 4 20 15 11 "ConsExt"
pause
ConsExt /window 5 4 20 15 11 "ConsExt"
pause>nul
cls
echo Change the window style again:
echo ConsExt /window 5 4 20 15 11 "ConsExt" "┌" "─" "┐" "│" " " "│" "└" "─" "┘" "├" "─" "┤"
pause
ConsExt /window 5 4 20 15 11 "ConsExt" "┌" "─" "┐" "│" " " "│" "└" "─" "┘" "├" "─" "┤"
pause>nul
cls
echo Next, display a rectangular box:
echo ConsExt /box x coordinate y coordinate width height background color foreground color [left character of top line] [middle character of top line] [right character of top line] [left character of middle line] [middle character of middle line] [right character of middle line] [left character of bottom line] [middle character of bottom line] [right character of bottom line]
echo.
echo Example: ConsExt /box 5 4 20 15 11 0
pause
ConsExt /box 5 4 20 15 11 0
pause>nul
cls
echo Display a button:
echo ConsExt /button x coordinate y coordinate width height background color border color title [title color]
echo.
echo Example: ConsExt /button 10 10 15 5 11 0 "Button" 13
pause
ConsExt /button 10 10 15 5 11 0 "Button" 13
pause>nul
cls
echo Display a message box:
echo ConsExt /msg x coordinate y coordinate width background color border color title prompt [prompt color] [number of buttons (1 or 2)] [left character of top line] [middle character of top line] [right character of top line] [left character of middle line] [middle character of middle line] [right character of middle line] [left character of bottom line] [middle character of bottom line] [right character of bottom line] [left character of separator line] [middle character of separator line] [right character of separator line]
echo.
echo %errorlevel% indicates the return value. If the return value is 1, it means "OK" is selected. If it is 2, it means "Cancel" is selected or the close button is clicked.
echo Example: ConsExt /msg 1 1 20 11 0 MSG "Message Box" 13 2
pause
ConsExt /msg 1 1 20 11 0 MSG "Message Box" 13 2
cls
if %errorlevel% equ 1 echo You selected OK.
if %errorlevel% equ 2 echo You selected Cancel or clicked Close.
pause
cls
echo Display a progress box:
echo ConsExt /prog x coordinate y coordinate width background color border color title prompt [prompt color] [progress value] [whether to draw border (1 draw, 0 not draw)] [left character of top line] [middle character of top line] [right character of top line] [left character of middle line] [middle character of middle line] [right character of middle line] [left character of bottom line] [middle character of bottom line] [right character of bottom line] [left character of separator line] [middle character of separator line] [right character of separator line]
echo.
echo Example: Display a progress box whose value ranges from 1-100.
echo ConsExt /prog 10 10 20 11 0 "Progress Bar" "Starting the next demonstration...0%%" 1 0 1
echo for /l %%i in (1,1,100) do (
echo ConsExt /prog 10 10 20 11 0 "Progress Bar" "Starting the next demonstration...%%i%%" 1 %%i 0
echo )
echo To avoid flickering, draw the border only once outside the loop.
pause
ConsExt /prog 10 10 20 11 0 "Progress Bar" "Starting the next demonstration...0%%" 1 0 1
for /l %%i in (1,1,100) do (
ConsExt /prog 10 10 20 11 0 "Progress Bar" "Starting the next demonstration...%%i%%" 1 %%i 0
)
cls
echo Display a list box:
echo ConsExt /listbox x coordinate y coordinate width height background color border color text color [list items 1-9]
echo.
echo Example: ConsExt /listbox 10 10 20 12 11 0 13 "List 1" "List 2" "List 3" "List 4" "List 5" "List 6" "List 7" "List 8" "List 9"
pause
ConsExt /listbox 10 10 20 12 11 0 13 "List 1" "List 2" "List 3" "List 4" "List 5" "List 6" "List 7" "List 8" "List 9"
pause>nul
cls
echo Fill a rectangular area with a specified color:
echo ConsExt /fillrect left coordinate of rectangular area top coordinate of rectangular area right coordinate of rectangular area bottom coordinate of rectangular area background color foreground color
echo.
echo Example: ConsExt /fillrect 10 1 30 15 14 13
pause
ConsExt /fillrect 10 1 30 15 14 13
pause>nul
cls
echo Delay:
echo ConsExt /sleep milliseconds
echo.
echo Example: ConsExt /sleep 1000
pause
echo Start delaying.
ConsExt /sleep 1000
echo Delay completed.
pause
cls
echo Get keyboard and mouse events:
echo ConsExt /event
echo.
echo Example:
echo :loop
echo ConsExt /event
echo set /a ret=%%errorlevel%%
echo if %ret% geq 1000 (
echo set /a "mouseY=ret%%1000"
echo set /a "mouseX=(ret-mouseY-1000)/1000"
echo Mouse clicked at!mouseX!,!mouseY!.
echo ) else (
echo if %ret% equ 27 echo You pressed the Escape key.
echo if %ret% equ 37 echo You pressed the left key.
echo if %ret% equ 38 echo You pressed the up key.
echo if %ret% equ 39 echo You pressed the right key.
echo if %ret% equ 37 echo You pressed the down key.
echo if %ret% equ 13 echo You pressed the Enter key.
echo echo Keyboard code: %ret%
echo )
pause
echo Start detecting keyboard and mouse events.
:loop
ConsExt /event
set /a ret=%errorlevel%
if %ret% geq 1000 (
set /a "mouseY=ret%%1000"
set /a "mouseX=(ret-mouseY-1000)/1000"
echo Mouse clicked at!mouseX!,!mouseY!.
) else (
if %ret% equ 27 echo You pressed the Escape key.
if %ret% equ 37 echo You pressed the left key.
if %ret% equ 38 echo You pressed the up key.
if %ret% equ 39 echo You pressed the right key.
if %ret% equ 37 echo You pressed the down key.
if %ret% equ 13 echo You pressed the Enter key.
echo Keyboard code: %ret%
)
pause
cls
echo Make the window flash:
echo ConsExt /flashwindow
echo.
echo Example: ConsExt /flashwindow
pause
echo Flash the window.
ConsExt /flashwindow
echo Flash completed.
pause
cls
echo Hide/show the caret:
echo ConsExt /crv [show (0)/hide (1)]
echo.
echo Example: ConsExt /crv 0
pause
echo Hide the caret.
ConsExt /crv 0
pause
echo Show the caret.
ConsExt /crv 1
pause
cls
echo Set the caret position:
echo ConsExt /pos x coordinate y coordinate
echo.
echo Example: ConsExt /pos 20 20
pause
ConsExt /pos 20 20
pause
cls
echo Check if a point is within a rectangular area:
echo ConsExt /ptinrect x coordinate y coordinate left coordinate of rectangular area top coordinate of rectangular area right coordinate of rectangular area bottom coordinate of rectangular area
echo.
echo Example: None.
pause
cls
echo Display time:
echo ConsExt /showtime x coordinate y coordinate background color foreground color [time zone +] [prompt]
echo.
echo Note: It must be started in a new thread using start "NewThread" /b, otherwise it won't make sense.
echo End the program by sending the WM_CLOSE message using ConsExt /close.
echo.
echo Example: start "NewThread" /b ConsExt.exe /showtime 10 10 1 15 8 "Local time: "
pause
start "NewThread" /b ConsExt.exe /showtime 10 10 1 15 8 "Local time: "
pause
cls
echo Close the window and exit the program called by start "NewThread" /b:
echo ConsExt /close
echo.
echo Example: ConsExt /close
pause
ConsExt /close