ToolBar height ?

Windows specific forum
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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!
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

O but i did, exactly as in your example above.
GetWindowRect_()
:P
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Edwin Knoppert wrote:O but i did, exactly as in your example above.
GetWindowRect_()
:P
?!
I use getClientRect_().

GPI
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Having an eye-ball problem ? :)
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

I give up
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Edwin Knoppert wrote:I give up
And i don't understand, what you want...
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

So what ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
blueb
Addict
Addict
Posts: 1120
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post 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
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post 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.

:)
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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 :wink: and about the TBMETRICS : it's only for toolbar gadget on WinXP system so i'll forget it right now.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

use :

Code: Select all

*TB = createToolbar(....)
GetWindowRect_(*TB,  rc.RECT)
height = rc\bottom
Post Reply