Dialog coordinates

I need to Create a static control in a dialog, and want to base it's position on another (dummy) control. If I call GetWindowRect on the dummy control, the coordinates it returns are relative to the frame window (i.e. including title bar etc), but the Create function for the new control seems to want coordinates relative to the dialog area within the frame (no title bar, borders etc). So the question is: What is the best way to get the coordinates of the dummy control relative to the dialog client area?

Thanks,

James Siddle
jamessiddleAsked:
Who is Participating?
 
Vinayak KumbarConnect With a Mentor Sr Program ManagerCommented:
Hi,

Happy it solved the prob. But u can still accept my comment as answer.

Thanks,

Good luck.
VinExpert
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

Have U tried with ScreenToClient() or ClientToScreen() functions for changing the co-ordinates w,r,t screen or dialog?

Try it out.
0
 
jamessiddleAuthor Commented:
Spot on - that solved the problem. Suggest it as an answer and I'll accept it. Thanks,

James Siddle
0
All Courses

From novice to tech pro — start learning today.