Click here to Skip to main content
15,920,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: file manager Pin
thes3cr3t111-Dec-03 11:01
thes3cr3t111-Dec-03 11:01 
GeneralRe: file manager Pin
David Crow12-Dec-03 2:41
David Crow12-Dec-03 2:41 
GeneralRe: file manager Pin
thes3cr3t112-Dec-03 5:40
thes3cr3t112-Dec-03 5:40 
GeneralRe: file manager Pin
David Crow12-Dec-03 5:44
David Crow12-Dec-03 5:44 
GeneralRe: file manager Pin
thes3cr3t112-Dec-03 6:00
thes3cr3t112-Dec-03 6:00 
QuestionHow to create buttons on the video Pin
Chinnaa Ganesh Kumar11-Dec-03 6:40
Chinnaa Ganesh Kumar11-Dec-03 6:40 
GeneralParent and child dialog, GetWindowRect() Pin
J.B.11-Dec-03 5:29
J.B.11-Dec-03 5:29 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
georgiek5011-Dec-03 5:50
georgiek5011-Dec-03 5:50 
I sympathize with you one this because I was doing the same thing last week only with more "layers" of windows and it got real confusing. Key points to remember:

1) Use GetClientRect to get the original size of the parent window
2) After you have resized with MoveWindow calculate the difference in width and height and store it somewhere for later use
3) Use GetWindowRect for the child window and MAKE SURE THE FIRST PARAMETER IS THE PARENT WINDOW...this is a common mistake that's easily overlooked.
4) Convert the rect.left and rect.top coordinates you just got with ScreenToClient to get client coordinates relative to the parent window
5) Final step, use SetWindowPos for the child windows with the difference in size (calculated earlier). eg.

// Apply the new height
lNewHeight = (rcTab.bottom - rcTab.top); // The original height calculate from GetWindowRect

lNewHeight += lDifference; // Add the difference calculated from the change in dimensions of the parent window. This will work regardless if the window became smaller or larger.

I hope I didn't confuse you more Smile | :)


GeneralRe: Parent and child dialog, GetWindowRect() Pin
J.B.11-Dec-03 15:26
J.B.11-Dec-03 15:26 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
georgiek5011-Dec-03 16:17
georgiek5011-Dec-03 16:17 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
J.B.11-Dec-03 16:39
J.B.11-Dec-03 16:39 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
georgiek5011-Dec-03 18:33
georgiek5011-Dec-03 18:33 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
J.B.12-Dec-03 16:39
J.B.12-Dec-03 16:39 
GeneralRe: Parent and child dialog, GetWindowRect() Pin
J.B.12-Dec-03 17:18
J.B.12-Dec-03 17:18 
GeneralProper way to process messages to modeless dialogs Pin
georgiek5011-Dec-03 5:22
georgiek5011-Dec-03 5:22 
GeneralUpper case Pin
Anonymous11-Dec-03 5:17
Anonymous11-Dec-03 5:17 
GeneralRe: Upper case Pin
valikac11-Dec-03 6:04
valikac11-Dec-03 6:04 
GeneralRe: Upper case Pin
Anonymous11-Dec-03 6:46
Anonymous11-Dec-03 6:46 
GeneralRe: Upper case Pin
Joe Woodbury11-Dec-03 6:59
professionalJoe Woodbury11-Dec-03 6:59 
GeneralSend virtual Ctrl-Alt-Del Pin
Albert Jann11-Dec-03 5:07
Albert Jann11-Dec-03 5:07 
GeneralRe: Send virtual Ctrl-Alt-Del Pin
David Crow11-Dec-03 7:31
David Crow11-Dec-03 7:31 
GeneralRe: Send virtual Ctrl-Alt-Del. I already found the answer Pin
Albert Jann11-Dec-03 9:09
Albert Jann11-Dec-03 9:09 
GeneralSending paste message to another application Pin
MB_OK11-Dec-03 3:49
MB_OK11-Dec-03 3:49 
GeneralRe: Sending paste message to another application Pin
MB_OK11-Dec-03 20:30
MB_OK11-Dec-03 20:30 
GeneralRe: Sending paste message to another application Pin
MB_OK11-Dec-03 20:32
MB_OK11-Dec-03 20:32 

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.