Click to See Complete Forum and Search --> : Get Control rect??


John_M_Gough
November 12th, 2007, 01:51 PM
Please Help
GetClientRect() or GetWindowRect() seems to only return the rect of the hole window.
how do i get the rect for a control eg STATIC or EDIT?

any help would be apreciated.

.pcbrainbuster
November 12th, 2007, 02:10 PM
Well, when you use GetClientRect or GetWindowRect simply specify the handle of your control in the first parameter.

Marc G
November 13th, 2007, 08:29 AM
Just like pcbrainbuster said.
Also i you use GetWindowRect, then use ScreenToClient function to translate from screen coordinates to any client coordinates you need.

John_M_Gough
November 14th, 2007, 10:44 AM
thankyou, Greatley apreciated