Dialog
-
I have a VC++ Dialog App and 1. want the Dialog not be be moved . ie i want to disable moving the window ! 2. If i make the main window movable how should I position the PropertySheet contained within . Assuming I have code like this void CCamProgrammerDlg::OnMove(int x, int y) { CDialog::OnMove(x, y); if(propertySheetCreated){ CRect r ; this->GetWindowRect(&r); mainSheet.SetWindowPos(0,r.left,r.top+30,r.Width(),r.Height()-75,0); } What I am asking is I hate to hardcode the offsets . I want the PropertySheet right below the Title bar of the mainWindow even after the main window moves ____________________________________________________ |__Main Window Title Bar __________________________|x| |__PropertySheet Title bar___________________________| |_Tab1_|Tab2__| | | | | | | PROPERTYSHEET + MAIN WND AREA | | | | | | | |____________________________________________________| | | | | | | | | | | | MAIN WINDOW AREA | | | | | | | |____________________________________________________| 3. IS it possible to create a PropertySheet without a Title Bar but not as a Child ! Engineering is the effort !
-
I have a VC++ Dialog App and 1. want the Dialog not be be moved . ie i want to disable moving the window ! 2. If i make the main window movable how should I position the PropertySheet contained within . Assuming I have code like this void CCamProgrammerDlg::OnMove(int x, int y) { CDialog::OnMove(x, y); if(propertySheetCreated){ CRect r ; this->GetWindowRect(&r); mainSheet.SetWindowPos(0,r.left,r.top+30,r.Width(),r.Height()-75,0); } What I am asking is I hate to hardcode the offsets . I want the PropertySheet right below the Title bar of the mainWindow even after the main window moves ____________________________________________________ |__Main Window Title Bar __________________________|x| |__PropertySheet Title bar___________________________| |_Tab1_|Tab2__| | | | | | | PROPERTYSHEET + MAIN WND AREA | | | | | | | |____________________________________________________| | | | | | | | | | | | MAIN WINDOW AREA | | | | | | | |____________________________________________________| 3. IS it possible to create a PropertySheet without a Title Bar but not as a Child ! Engineering is the effort !
I will answer 1. Handle OnNcHitTest and tell the system the mouse click was on the client area when it is actual hit on the caption. Here is the code
UINT CMyDlg::OnNcHitTest(CPoint point) { UINT ret = CDialog::OnNcHitTest(point); if(ret == HTCAPTION ) return HTCLIENT; else return ret; }