bug _ypixels in BDEBUGGER

May 22, 2013
34
0
The follwing simple btm file displays the problem.

@echo off
echo %_ypixels
quit

Let we say, the screen resolution is 1920 x 1080. On excution, the batch will display: 1080

Now, on windows 10, click right on screen and select "Display setting". Under "Scale and Layout", Change te size to 125%
Again execute the simple script. Now it will display 864 (1080/125*100) as expected.

But now runt the script in the debugger. It will display the wrong value 1080!
In other words, TCC correctly sees the scaling, but the debugger does not. No problem once you know what happens. But many laptops are set to 125% by default.

GRTNX
Ruud Uphoff
 
May 20, 2008
11,285
95
Syracuse, NY, USA
I think the debugger gets it right. The number of pixels is a physical characteristic of the monitor (isn't it?). I don't think it changes when you make windows, icons, and text bigger; the desktop stays the same size.
 
May 22, 2013
34
0
I think the debugger gets it right. The number of pixels is a physical characteristic of the monitor (isn't it?). I don't think it changes when you make windows, icons, and text bigger; the desktop stays the same size.

TCC corectly detects a screen size of 1536 x 864, if that's wrong, al scripts I wrote between 2010 or ealier, are illegal correct working, because TCC in error detects the right size of _pixels.

For good understanding, the bug results in scrips using _xpixels or _ypixels, that normally work fine, no longer work when running in bdebugger if the size of the display, differs from the resolution

Regardless any opinion, it is a bug.

Kind regards,
Ruud Uphoff
 

rconn

Administrator
Staff member
May 14, 2008
12,312
147
It's a Windows issue, not TCC or the debugger.

%_ypixels simply returns the result of the Windows API GetSystemMetrics( SM_CYSCREEN ). The reason for the difference is that when you're running in TCC (a console app), you get the scaled value back from Windows. When you're in the debugger, you're not running TCC -- you're running a GUI app that's using the TCC engine (TakeCmd.dll). And when you're in a GUI app and you make that call, you do *not* get the scaled value.

Why Microsoft implemented it this way (feature? bug?) is something only they can answer.
 
May 22, 2013
34
0
It's a Windows issue, not TCC or the debugger.

%_ypixels simply returns the result of the Windows API GetSystemMetrics( SM_CYSCREEN ). The reason for the difference is that when you're running in TCC (a console app), you get the scaled value back from Windows. When you're in the debugger, you're not running TCC -- you're running a GUI app that's using the TCC engine (TakeCmd.dll). And when you're in a GUI app and you make that call, you do *not* get the scaled value.

Why Microsoft implemented it this way (feature? bug?) is something only they can answer.
Thanks,

Aha.. Of course, this explains the difference.
It is not a real problem. Just set the screen to 100% while debugging. I just was wondering.

Kind regards,
Ruud
 
Similar threads
Thread starter Title Forum Replies Date
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
R strange bug? Support 7
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
M Server 2019 Bug with @execstr? Support 14
E Fixed Bug with DIR /Z displaying descriptions Support 8
E Text copy bug Support 1
x13 SETARRAY /Z bug Support 6
Gamegod ffind bug with chinese Support 2
Dick Johnson cdd - is this a bug or a feature? Support 7
P "Set" command behavior - a bug? Support 3
nikbackm TCC 20 variable expansion bug Support 6
gentzel Bug launching external commands in 20.11.43 Support 11
R Is this a bug in SETARRAY? Support 2
M Windows Installer bug? Support 4
vefatica @SCRIPT bug persists Support 4
M Little bug, big consequences .. Support 6
fishman@panix.com Once again the Can't Install bug bites... Support 2
gentzel Fixed dirs +n bug in 20.0.12 x64 Support 2
M Bug in Windows 10, when adding symbol to task bar Support 6
Alpengreis [Bug?] View (V) Prefs Error (TC 18.00.27 x64) Support 4
D WAD Minor Post Installation Bug in V18 Support 1
I Possible Bug: History /n Returns Nothing Support 3
samintz WAD Weird REN bug Support 6
Jay Sage WAD Possible Bug in Batch Parameters Support 7
G Bug? TCC 16.03.55 Console Palette Support 4
S Return of FTP copy bug in 16.02.48 Support 12
S XenForo bug Support 3
D TCMD16 Delete Toolbar Button bug Support 7
keithg1964 WAD 16.0027 Alias /rz bug Support 8
rfaquino WAD Apparently a bug when expanding environment variable %ProgramFiles(x86) Support 2
T Documentation @LINE[CON,n] @LINES[CON] not documented (bug?) Support 4
H TIMER bug Support 4
G Fixed @REREPLACE bug Support 15
G WAD PDIR @IF bug, @WORD bug Support 8
T Bug in TCMD but not in TCC Support 8
M WAD A complaint regarding a very irritating TCC installation behavior... (Bug?) Support 4
nickles Renaming bug? Support 9
nickles Redirect bug? Support 4
nickles UrlDecode() bug? Support 3
P WAD Bug in TC v 13.03 build 39 x64 Support 1
S Debug feature bug? Support 17
Roedy CDD /S bug Support 3
J TCCLE 12.11 dirhistory bug Support 1
S MOVE from FTP directory to another FTP directory - bug?? Support 2
T Bug in variable expansion Support 4
M An undocumented limitation and an associated minor bug... Support 1
M High-Precision arithmetic bug... Support 1
nickles REN bug Support 11
Y 12.1 Bug ? Support 2
lassevk exit(1) in a python script exits console, by design or bug? Support 1

Similar threads