DosTips.com

A Forum all about DOS Batch
It is currently 29 May 2017 09:09

All times are UTC-06:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 03 Feb 2017 12:36 
Offline

Joined: 23 Nov 2015 09:34
Posts: 28
Why are the two options "print" and "Scan" not affected correctly? I've set the coordinate range to cover each word for the hovering according to the errorlevel it gives when I click on "print" and "scan"...

Code: Select all
color 07 & cls
echo Choose an option:
echo Print
echo Scan
GetInput /M -65536 0 -65540 0 -131072 0 -131078 0 /H
if %errorlevel%==-65537 echo Print selected
if %errorlevel%==-131072 echo Scan selected
pause


Top
   
PostPosted: 03 Feb 2017 13:12 
Online
Expert

Joined: 06 Dec 2011 22:15
Posts: 1371
Location: México City, México
GetInput.txt help file wrote:
GetInput [/T msecs] [/I] [{"chars"|keycode}...]
[ /M left top right bottom ... [/H [h1 h2 h3 ...]] ]

/M l t r b ... Coordinates of input selection boxes for mouse clicks.

...

If a list of coordinates for selection boxes is given, the *position* of the
selected box in the list is returned starting at one; ...

...

When no /M switch (list of selection boxes) is given, mouse button click
positions are returned as negative errorlevel values.

...

Screen coordinates start in 0 0 at the left-top corner of the screen.


That is:

Code: Select all
@echo off

color 07 & cls
echo Choose an option:
echo Print
echo Scan
rem          Print                    "Print" is in line 1, in columns 0 to 4
rem                   Scan            "Scan" is in line 2, in columns 0 to 3
GetInput /M  0 1 4 1  0 2 3 2 /H
if %errorlevel%==1 echo Print selected
if %errorlevel%==2 echo Scan selected
pause

Antonio


Top
   
PostPosted: 03 Feb 2017 16:40 
Offline

Joined: 23 Nov 2015 09:34
Posts: 28
@Aacini

Thank you, I'm studying more of the documentation to get a better understanding.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: Aacini, Compo, jeb, Yahoo [Bot], zimxavier and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited