Print Page | Close Window

GetClientRect returns wrong values

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=19905
Printed Date: 25 April 2024 at 12:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetClientRect returns wrong values
Posted By: Micca
Subject: GetClientRect returns wrong values
Date Posted: 29 June 2012 at 4:06am
The function GetClientRect returns wrong values for Right and Bottom if the windows text size (DPI) is set to 110%.
The text size 100%, 125% or 150% works fine.
With all other text size values the function GetClientRect returns wrong value.

I use this code at the resize event of the command bar:

cbrMenu.GetClientRect Left, Top, right, bottom
picMain.Move Left, Top, right - Left, bottom - Top


Example for windows text size (DPI) 100%:

You see the black border of the picture box at every side.

Example for windows text size (DPI) 110%:

The picture box is too large now. The black border of the
picture box at the right and bottom is missing.

Please can you fix this ugly bug?



-------------
Micca

---------------------

Product: Xtreme Commandbars (ActiveX) Version 17.2

Platform: Win7 64bit

Language: Visual Basic 6.0 SP6



Replies:
Posted By: Micca
Date Posted: 18 July 2012 at 4:33am
i run the same test with Xtreme Commandbars (ActiveX) v15.3.1 (30 Day Trial).
the bug with the wrong values exist at the newest version too.

any feedback from the developers?

-------------
Micca

---------------------

Product: Xtreme Commandbars (ActiveX) Version 17.2

Platform: Win7 64bit

Language: Visual Basic 6.0 SP6


Posted By: Willowmaster
Date Posted: 20 July 2012 at 3:02am
I think it's best if you open a support ticket.

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: DKnowles
Date Posted: 02 August 2012 at 5:13am
Keep us informed if you do get a response Micca. We too are using the function GetClientRect and would be interested to here any response you get.


Posted By: Micca
Date Posted: 21 August 2012 at 4:20am
i have created a support ticket at 28-Jul-2012:

The function GetClientRect returns wrong values for Right and Bottom if the windows text size (DPI) is set to 110%.
The text size 100%, 125% or 150% works fine.
With all other text size values the function GetClientRect returns wrong value.
Please check the message at your forum for more details and screenshots:
http://forum.codejock.com/forum_posts.asp.TID=19905


i get a reply at 02-Aug-2012:

I have check your issue, and it reproduced with 110%, thought only with the bottom ('right' coordinate was ok)
Doubled checked the code and it really seems to be fine, it's using Microsoft function TransformCoords
http://msdn.microsoft.com/en-us/library/windows/desktop/ms692818(v=vs.85).aspx
Which gives some more ole points than needed in non-standard DPI configuration.
Looks like a bug of TransformCoords?
It was 7 points in my case, so i believe it excludes any floating point to integer conversion loss.
Did you tried a workaround: subtracting some space (1-2-3-4-5-6-... ?) from the right/bottom when using 110% DPI?


my answer at 03-Aug-2012:

Many customer use different DPI settings depending on the screen resoltuion and the real screen size.
110% is just one value i select for testing.
If you use a value different than 100,125 or150 creates this problem.
I tried to subtract some values but after that i found out that the difference changes after you resize the form.
If i make the form larger the difference get higher.
After the form gets smaller the difference gets smaller too.
No workout for that.
I have attached my vb6 test project for you. maybe you can reproduce the problem better.
Im testing with win7 64bit.


still waiting for any feedback now....


-------------
Micca

---------------------

Product: Xtreme Commandbars (ActiveX) Version 17.2

Platform: Win7 64bit

Language: Visual Basic 6.0 SP6


Posted By: DKnowles
Date Posted: 16 April 2013 at 11:56am
Thanks for the update Smile


-------------
David



Product: Xtreme Toolkit Version 16.4

Platform: Windows 10

Language: Visual DataFlex 18.2


Posted By: PPL1
Date Posted: 08 February 2018 at 11:29am
Hi,

FWIW, 5 years later, I found out that setting the .ScaleMode to pixels fixes the issue. GetClientRect returns the correct client info.

Pierre



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net