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

C / C++ / MFC

 
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 
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 
Hi georgiek50,
thanks for the reply. My drawing turns out to be a little misleading. frameRect and childRect are values for the SUBFRAME (a Group Box) and child dialog respectively, so neither of them is the main dialog (main window). The SUBFRAME placed inside the main dialog is used a reference box which the child dialo later created needs sit at the centre of it. In this case, to guess what you mean, the 150 now will be the "top" value of the SUBFRAME relative to the main window, correct? And the 30 will be the "top" value of the child dialog relative to the SUBFRAME?

If my guess is right, to let the child dialog to sit at the centre of the SUBFRAME, shouldn't it just be

pMainDlg->SetWindowPos(this, frameRect.left + ((frameRect.Width() - childRect.Width())/2),
    frameRect.top + ((frameRect.Height() - childRect.Height()) / 2),
    childRect.Width(), childRect.Height(), SWP_NOZORDER);

in the main dialog's OnInitDialog(). pMainDlg is the pointer to the child dialog.

Sorry for the trouble, appreciate any further help.

EDIT: further obersve the CRect value of the main dialog from

GetClientRect(&mainRect)


mainRect {top=0 bottom=465 left=0 right=606}
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 
GeneralCTreeCtrl weird problem Pin
rpadrela11-Dec-03 3:43
rpadrela11-Dec-03 3:43 
GeneralRe: CTreeCtrl weird problem Pin
Andrew Komiagin11-Dec-03 4:50
Andrew Komiagin11-Dec-03 4:50 
GeneralRe: CTreeCtrl weird problem Pin
rpadrela11-Dec-03 5:04
rpadrela11-Dec-03 5:04 
GeneralIterate through all the controls on CFormView Pin
Abebe11-Dec-03 2:44
Abebe11-Dec-03 2:44 
GeneralRe: Iterate through all the controls on CFormView Pin
jmkhael11-Dec-03 2:55
jmkhael11-Dec-03 2:55 

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.