Page 2 of 2
Posted: Sat Jul 26, 2003 11:40 pm
by GPI
>GetClientRect is not the way to do it..
>unless you want the client area's height.
Then use GetWindowRect and
h=rect\bottom-rect\top
>You where asking the toolbar's height.
>This might result in the similar value for now but what if billy changes
>windows again?
Then tell us a methode, which works on all systems!
Posted: Sun Jul 27, 2003 7:29 am
by Edwin Knoppert
O but i did, exactly as in your example above.
GetWindowRect_()

Posted: Sun Jul 27, 2003 9:57 am
by GPI
Edwin Knoppert wrote:O but i did, exactly as in your example above.
GetWindowRect_()

?!
I use getClientRect_().
GPI
Posted: Sun Jul 27, 2003 10:47 am
by Edwin Knoppert
Having an eye-ball problem ?

Posted: Sun Jul 27, 2003 3:40 pm
by Flype
perhaps the more compliant way of coding it is to detect windows version.
If <=Win2000 : Use GetClientRect_()
If not : use the TBMETRICS method !
So that, no more future problem compatibily :roll:
Posted: Sun Jul 27, 2003 7:20 pm
by Edwin Knoppert
I give up
Posted: Sun Jul 27, 2003 7:44 pm
by GPI
Edwin Knoppert wrote:I give up
And i don't understand, what you want...
Posted: Mon Jul 28, 2003 1:34 am
by Flype
So what ?
Posted: Mon Jul 28, 2003 3:03 pm
by blueb
Edwin has been trying to tell you from from the beginning:
"While the GetClientRect function may appear to give you the correct results (until a new version of Windows comes out)... the correct way is to use the GetWindowRect function. Subtracting the top value from the bottom value will give you the height of the toolbar."
HTH,
--blueb
Posted: Mon Jul 28, 2003 4:00 pm
by Edwin Knoppert
Thanks, indeed.
However someone mentioned TBMETRICS, i'm not familiar with this one.
Might work fine but do inspect measuriung during a wrapped toolbar.
You might need the occupied height over the 'default(single row)' toolbar height.
The height is usually required to align other controls on a window.
Therefore mentioning the getwindowrect.

Posted: Tue Jul 29, 2003 1:22 am
by Flype
very thanx for your answers and sorry Edwin Knoppert i didn't understand as i should do because of my approximately english. Your code works well, so

and about the TBMETRICS : it's only for toolbar gadget on WinXP system so i'll forget it right now.
Posted: Wed Jul 30, 2003 4:31 pm
by eddy
use :
Code: Select all
*TB = createToolbar(....)
GetWindowRect_(*TB, rc.RECT)
height = rc\bottom