Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - GetClientRect returns wrong values
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetClientRect returns wrong values

 Post Reply Post Reply
Author
Message
Micca View Drop Down
Groupie
Groupie


Joined: 26 November 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Micca Quote  Post ReplyReply Direct Link To This Post Topic: GetClientRect returns wrong values
    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
Back to Top
Micca View Drop Down
Groupie
Groupie


Joined: 26 November 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Micca Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
DKnowles View Drop Down
Groupie
Groupie
Avatar

Joined: 03 April 2012
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote DKnowles Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Micca View Drop Down
Groupie
Groupie


Joined: 26 November 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Micca Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
DKnowles View Drop Down
Groupie
Groupie
Avatar

Joined: 03 April 2012
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote DKnowles Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
PPL1 View Drop Down
Groupie
Groupie


Joined: 10 April 2006
Location: Canada
Status: Offline
Points: 70
Post Options Post Options   Thanks (2) Thanks(2)   Quote PPL1 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.