To make a non-modal or other dialog: Add Resource - Dialog Change the IDD and the title of the dialog Set Tool Window to True for non-modal Right click it, Add Class Change base to CDialog Remove DECLARE_DYNAMIC from header and IMPLEMENT_DYNAMIC from .cpp Remove afxdialogex.h include Change CDialog to CBaseDlg in .h and .cpp Under DoDataExchange add: virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel(); (Not needed for modal if there is nothing to do) And for non-modal: virtual void PostNcDestroy(); virtual BOOL PreTranslateMessage(MSG* pMsg); The latter is needed if there is any edit box Also add a CloseWindow() as public if it is necessary to close the window externally It can call OnOK, OnCancel, or DestroyWindow as needed. In nonmodal, add to construction: mNonModal = true; --------------------- BOOL CHoleFinder::OnInitDialog() { CBaseDlg::OnInitDialog(); SetDefID(45678); // Disable OK from being default button for non-modal return TRUE; } These are the kinds of basic entries needed for nonmodal where placement is stored void CHoleFinder::OnOK() { OnCancel(); (For common closing actions to occur if any) } // Inform managing module of closing, or store placement and NULL out pointer // right here void CHoleFinder::OnCancel() { //mWinApp->GetScreenShotPlacement(); //mWinApp->mScreenShotDialog = NULL; DestroyWindow(); } void CHoleFinder::PostNcDestroy() { delete this; CDialog::PostNcDestroy(); } BOOL CHoleFinder::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) SetFocus(); return CDialog::PreTranslateMessage(pMsg); } Probably OnOK should call CBaseDlg::OnOK, and OnCancel should call CBaseDlg::OnCancel (although the latter might be problematic if OnOK calls OnCancel, but this is not done universally Copy the "?" help button from another dialog ---------------------- Add class pointer and placement to managing module and functions to open and get placement Be sure to set the right IDD_ in the Create call. Change font to Microsoft Sans Serif (it will change Use System font to False) XXX Commit changes and push for editing at 120 DPI Switch to 125% for editing at 120 DPI NOn-modal dialogs have a problem with double validation of edit fields and you need to use BaseDlg MinMaxInt and MinMaxFloat functions with the ID of the field and a descriptor text. MinMaxFloat(IDC_EDIT_ACS_BEAM_SHIFT, m_fBeamShift, -10.f, 10.f, "Beam shift for centering"); Or better yet, replace the preceding DDX_Text too with DDX_MM_INT or DDX_MMF_LOAT -------------------------------------------- Adding a help file: Copy an existing file to get started. Change the hidd_ NAME entry (although this doesn't matter if it is wrong). Use a right-click to add the file in the help files section (?) Add to aliases.h Add to SerialEM.hhc and SerialEM.hhp Add to SerialEM.vcxproj somewhere in the 10 help dependency lines with find and replace. If it crashes when you push the button, make sure that DoDataExchange calls CBaseDlg::DoDataExchange, not CDialog::DoDataExchange If the button does not work, make sure that BEGIN_MESSAGE_MAP has CBaseDlg not CDialog