Click here to Skip to main content
15,902,275 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: application configuration is incorrect Pin
David Crow5-Nov-06 6:37
David Crow5-Nov-06 6:37 
GeneralRe: application configuration is incorrect Pin
Michael Dunn4-Nov-06 10:26
sitebuilderMichael Dunn4-Nov-06 10:26 
GeneralRe: application configuration is incorrect Pin
edvintas4-Nov-06 10:49
edvintas4-Nov-06 10:49 
QuestionGet keys of HKEY_CURRENT_USER Pin
Daniel Kanev4-Nov-06 6:43
Daniel Kanev4-Nov-06 6:43 
AnswerRe: Get keys of HKEY_CURRENT_USER Pin
Waldermort4-Nov-06 7:19
Waldermort4-Nov-06 7:19 
AnswerRe: Get keys of HKEY_CURRENT_USER Pin
Hamid_RT4-Nov-06 20:40
Hamid_RT4-Nov-06 20:40 
QuestionGetWindowRect() Pin
Waldermort4-Nov-06 5:46
Waldermort4-Nov-06 5:46 
AnswerRe: GetWindowRect() Pin
Steve Echols4-Nov-06 19:16
Steve Echols4-Nov-06 19:16 
Not sure exactly how you're implementing your anchoring, but GetWindowRect get's the coordinates in screen coordinates, but the moving/sizing functions (MoveWindow, SetWindowPos, etc) work in client coordinates.

You can use ClientToScreen and ScreenToClient functions to translate between the two. If you move a parent window, the children will move also, since they're relative to the parent, so you shouldn't need to move the children of the children (but you will need to resize them).

This code will leave the child control at it's current x, y position, but adjust the child width based on the parent width:

::GetClientRect(m_hParentWnd, &rcParent);    // will be (0, 0, width, height )<br />
::GetClientRect(m_hChildWnd, &rcChild);<br />
<br />
// resize the child's width, based on the parent's width maintaining the current spacing<br />
rcChild.right = rcParent.right - ( rcParent.right - rcChild.right );<br />
<br />
::MoveWindow( m_hChildWnd, rcChild.left, rcChild.top, rcChild.right - rcChild.left, rcChild.bottom - rcChild.top, TRUE );<br />



- S
50 cups of coffee and you know it's on!

GeneralRe: GetWindowRect() Pin
Waldermort4-Nov-06 21:15
Waldermort4-Nov-06 21:15 
GeneralRe: GetWindowRect() Pin
Steve Echols4-Nov-06 21:21
Steve Echols4-Nov-06 21:21 
QuestionHOWTO: get CMenu information from a CMenu pointer Pin
Mohammad A Gdeisat4-Nov-06 5:25
Mohammad A Gdeisat4-Nov-06 5:25 
AnswerRe: HOWTO: get CMenu information from a CMenu pointer Pin
Mark Salsbery4-Nov-06 8:05
Mark Salsbery4-Nov-06 8:05 
GeneralRe: HOWTO: get CMenu information from a CMenu pointer Pin
Mohammad A Gdeisat4-Nov-06 10:53
Mohammad A Gdeisat4-Nov-06 10:53 
GeneralRe: HOWTO: get CMenu information from a CMenu pointer Pin
Mark Salsbery4-Nov-06 12:23
Mark Salsbery4-Nov-06 12:23 
GeneralRe: HOWTO: get CMenu information from a CMenu pointer Pin
Mohammad A Gdeisat4-Nov-06 19:50
Mohammad A Gdeisat4-Nov-06 19:50 
GeneralRe: HOWTO: get CMenu information from a CMenu pointer Pin
Mark Salsbery4-Nov-06 22:48
Mark Salsbery4-Nov-06 22:48 
QuestionAbout Multi Core Pin
bouli4-Nov-06 5:17
bouli4-Nov-06 5:17 
AnswerRe: About Multi Core Pin
Mark Salsbery4-Nov-06 8:42
Mark Salsbery4-Nov-06 8:42 
GeneralRe: About Multi Core Pin
bouli4-Nov-06 13:54
bouli4-Nov-06 13:54 
GeneralRe: About Multi Core Pin
Mark Salsbery4-Nov-06 16:07
Mark Salsbery4-Nov-06 16:07 
GeneralRe: About Multi Core Pin
bouli5-Nov-06 0:28
bouli5-Nov-06 0:28 
GeneralRe: About Multi Core Pin
Mark Salsbery5-Nov-06 8:14
Mark Salsbery5-Nov-06 8:14 
GeneralRe: About Multi Core Pin
bouli5-Nov-06 8:21
bouli5-Nov-06 8:21 
GeneralRe: About Multi Core Pin
Mark Salsbery5-Nov-06 8:53
Mark Salsbery5-Nov-06 8:53 
AnswerRe: About Multi Core Pin
Mark Salsbery4-Nov-06 8:57
Mark Salsbery4-Nov-06 8:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.