ToolBar height ?
>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!
>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

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

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
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:
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
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
-
Edwin Knoppert
- Addict

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

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

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.
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.
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
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
use :
Code: Select all
*TB = createToolbar(....)
GetWindowRect_(*TB, rc.RECT)
height = rc\bottom
