When I invoke a getClientrect for my statusbar, the Right and Bottom come back correctly, but the Left and Top are always zero.

The same code works fine for Button, Edit, Static, ect.

Is there a special way required to get the geometry of a statusbar?
Posted on 2005-11-18 00:09:26 by mikes

Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

Look in MSDN/PlatformSDK... what you want is probably GetWindowRect.
Posted on 2005-11-18 00:22:39 by f0dder
GetClientRect gets the size of the client area, which means all of the window excluding the caption and borders. GetWindowRect gets the coordinates of your entire window area, not just the client part, and the coordinates are relative to the screen.


Hope that helps :)
Posted on 2005-11-18 10:54:34 by QvasiModo
Hello Mikes,

Use GetClientRect, and pass handle of status bar.  Status bar is the window and will return coordinates you need.

best regards,

Posted on 2005-11-18 20:50:24 by czDrillard

I am using GetClientRect with the handle of the statusbar. It works with other controls, but not the statusbar.

That was the whole point of my original post. It returns Right and Bottom but Left and Top are always 0.

Thanks for your help.

Posted on 2005-11-18 22:57:15 by mikes