GetRectCheckSum on extended monitor returns unexpected results
Moderators: Dorian (MJT support), JRL
GetRectCheckSum on extended monitor returns unexpected results
Using GetRectCheckSum on extended monitors returns unexpected results and always seems to return the same value no mater the bounding rectangle within the second monitor. As expected, use of GetRectCheckSum on the primary monitor works as intended.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: GetRectCheckSum on extended monitor returns unexpected results
I'm not able to replicate this in v15.0.20.
Assuming your coordinates are good (Bottom X should always be larger than Top X, Bottom Y should always be larger than Bottom Y), I wonder if Macro Scheduler isn't polling the 2nd monitor. This happens sometimes when a 2nd monitor is added when Macro Scheduler is already running. It happens rarely, but I have seen it happen. Does it resolve the issue if you restart Macro Scheduler?
Changing 1098 to 1078 returns different values as expected.
Assuming your coordinates are good (Bottom X should always be larger than Top X, Bottom Y should always be larger than Bottom Y), I wonder if Macro Scheduler isn't polling the 2nd monitor. This happens sometimes when a 2nd monitor is added when Macro Scheduler is already running. It happens rarely, but I have seen it happen. Does it resolve the issue if you restart Macro Scheduler?
Code: Select all
//2nd monitor (extended vertically)
GetRectCheckSum>1098,952,1860,1353,cs
put>cs
//cs:
//Chrome 2061424441
//File manager 2538076754
//Desktop 12701178079
Yes, we have a Custom Scripting Service. Message me or go here
Re: GetRectCheckSum on extended monitor returns unexpected results
I'll do more testing on this end.
For the results above I was using Win7, MS 15.0.19, and Y1=Y2, a horizontal line essentially. I'll try Y1 and Y2=Y1+1 instead. If that fails I'll try Win10.
Thanks for the tips.
For the results above I was using Win7, MS 15.0.19, and Y1=Y2, a horizontal line essentially. I'll try Y1 and Y2=Y1+1 instead. If that fails I'll try Win10.
Thanks for the tips.
Re: GetRectCheckSum on extended monitor returns unexpected results
Here is a test script, the desktop background was changed to Solid Red so the CRC should be equal.
This was compiled and tested on Win7 and Win10, MS 15.0.19b with the same results.
Other functions like GetPixel, WaitPixelColor, ScreenCapture all work fine when working with the secondary monitor
The results seem to indicate that GetRectCheckSum is somehow mirroring the primary monitor
I did restart MS15
I did reboot the PC
This did not resolve the unexpected results
This was compiled and tested on Win7 and Win10, MS 15.0.19b with the same results.
Other functions like GetPixel, WaitPixelColor, ScreenCapture all work fine when working with the secondary monitor
Code: Select all
//SETUP: solid RED color desktop, 2 monitors horizontal
GoSub>SampleCRC
Let>MSG=CRC of desktop background:%CRLF%
Let>MSG=%MSG%Monitor 1 %RESULT1% <-CRC of RED background%CRLF%
Let>MSG=%MSG%Monitor 2 %RESULT2% <-CRC of RED background%CRLF%%CRLF%
Let>MSG_HEIGHT=300
Let>MSG_WIDTH=400
MDL>MSG
RunProgram>notepad.exe
Wait>1
Let>WTITLE=Untitled - Notepad
//move notepad to monitor 1
MoveWindow>WTITLE,0,0
ResizeWindow>WTITLE,800,800
Wait>1
GoSub>SampleCRC
Let>MSG=%MSG%Notepad on Monitor 1:%CRLF%
Let>MSG=%MSG%Monitor 1 %RESULT1% <-CRC of Notepad WHITE background%CRLF%
Let>MSG=%MSG%Monitor 2 %RESULT2% <-CRC of RED background%CRLF%%CRLF%
MDL>MSG
//move notepad to monitor 2
MoveWindow>WTITLE,1920,0
Wait>1
GoSub>SampleCRC
Let>MSG=%MSG%Notepad on Monitor 2:%CRLF%
Let>MSG=%MSG%Monitor 1 %RESULT1% <-CRC of RED background%CRLF%
Let>MSG=%MSG%Monitor 2 %RESULT2% <-CRC of Notepad WHITE background%CRLF%%CRLF%
MDL>MSG
PutClipBoard>MSG
WindowAction>3,WTITLE
SRT>SampleCRC
//monitor 1
GetRectCheckSum>100,100,200,200,RESULT1
//monitor 2 (horizontal to the right)
GetRectCheckSum>{1920+100},100,{1920+200},200,RESULT2
END>SampleCRC
/*
CRC of desktop background:
Monitor 1 847766042 <-CRC of RED background
Monitor 2 847766042 <-CRC of RED background
^expected results
Notepad on Monitor 1:
Monitor 1 98279228 <-CRC of Notepad WHITE background
Monitor 2 98279228 <-CRC of RED background
^notepad open, why do CRCs match?
Notepad on Monitor 2:
Monitor 1 847766042 <-CRC of RED background
Monitor 2 847766042 <-CRC of Notepad WHITE background
^notepad open, why do CRCs match?
*/
The second monitor was always attached.Dorian (MJT support) wrote: ↑Fri Jun 10, 2022 12:14 pmThis happens sometimes when a 2nd monitor is added when Macro Scheduler is already running. It happens rarely, but I have seen it happen. Does it resolve the issue if you restart Macro Scheduler?
I did restart MS15
I did reboot the PC
This did not resolve the unexpected results
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: GetRectCheckSum on extended monitor returns unexpected results
I was out of ideas on this so asked Marcus. He has asked if the settings are different on the second monitor? (different resolutions, colour depths etc).
Yes, we have a Custom Scripting Service. Message me or go here
Re: GetRectCheckSum on extended monitor returns unexpected results
Same brand monitor, same resolution, same color depth, and most importantly the same color profiles (no profile).
The script above can be easily run if you have a solid color desktop background and horizontally placed monitors.
Thanks
The script above can be easily run if you have a solid color desktop background and horizontally placed monitors.
Thanks