Click here to Skip to main content
15,904,951 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Validate and Invalidate in RedrawWindow() Pin
prasad_som27-Dec-06 18:08
prasad_som27-Dec-06 18:08 
GeneralRe: Validate and Invalidate in RedrawWindow() Pin
rp_suman2-Jan-07 5:19
rp_suman2-Jan-07 5:19 
QuestionTab Control in existing dialog box Pin
acerunner31618-Dec-06 14:07
acerunner31618-Dec-06 14:07 
QuestionRe: Tab Control in existing dialog box Pin
Mark Salsbery18-Dec-06 15:01
Mark Salsbery18-Dec-06 15:01 
AnswerRe: Tab Control in existing dialog box Pin
acerunner31618-Dec-06 15:11
acerunner31618-Dec-06 15:11 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery18-Dec-06 15:30
Mark Salsbery18-Dec-06 15:30 
GeneralRe: Tab Control in existing dialog box [modified] Pin
acerunner31618-Dec-06 15:35
acerunner31618-Dec-06 15:35 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery19-Dec-06 6:23
Mark Salsbery19-Dec-06 6:23 
It'll just take a little rearranging....not too much code.

acerunner316 wrote:
how do I change my existing
dialog (which is the main dialog window for the project) to a child? And how to I set another
window (frame window) to be the new parent of the project?


In your application class' InitInstance() override you probably have something like this:
CMyMainDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
...

You'd replace that with something like:
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
    return FALSE;
m_pMainWnd = pFrame;
if (!Create(NULL, _T("Window Name"),
        WS_VISIBLE|WS_OVERLAPPEDWINDOW,
        CRect(50,50,400,400), NULL, NULL, 0, NULL))
    return FALSE;
...

CMainFrame would be a CFrameWnd-derived class. You can override CFrameWnd::OnCreateClient() and
in your implementation create the tab window and the two modeless dialogs.
All the necessary code for managing a tab control will need to be added as well.

acerunner316 wrote:
Also, would it be necessary for
the main window to have OnInitDialog, OnSysCommand, OnPaint, and OnQueryDragIcon. In which case,
I would have to add those functions in the new main window, and remove them from what is now the
child window? And also transfering the system menu (including the about...)?


The main window has OnCreateClient(). Instead of OnInitDialog there's OnCreate() (handler for
WM_CREATE). Your dialog classes would stay the same. They still need their OnInitDialog()
overrides to initialize their controls and whatever else you do there. Same with OnPaint.
OnQueryDragIcon., OnSysCommand, and the about-window stuff would probably move to the frame
window class.
GeneralRe: Tab Control in existing dialog box [modified] Pin
acerunner31619-Dec-06 8:30
acerunner31619-Dec-06 8:30 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery19-Dec-06 9:05
Mark Salsbery19-Dec-06 9:05 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31619-Dec-06 13:47
acerunner31619-Dec-06 13:47 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery19-Dec-06 15:33
Mark Salsbery19-Dec-06 15:33 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31619-Dec-06 15:55
acerunner31619-Dec-06 15:55 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 7:14
Mark Salsbery20-Dec-06 7:14 
GeneralRe: Tab Control in existing dialog box [modified] Pin
acerunner31620-Dec-06 9:52
acerunner31620-Dec-06 9:52 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 10:07
Mark Salsbery20-Dec-06 10:07 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31620-Dec-06 10:21
acerunner31620-Dec-06 10:21 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 11:20
Mark Salsbery20-Dec-06 11:20 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 11:43
Mark Salsbery20-Dec-06 11:43 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 11:51
Mark Salsbery20-Dec-06 11:51 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31620-Dec-06 12:21
acerunner31620-Dec-06 12:21 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 12:29
Mark Salsbery20-Dec-06 12:29 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31620-Dec-06 12:51
acerunner31620-Dec-06 12:51 
GeneralRe: Tab Control in existing dialog box Pin
Mark Salsbery20-Dec-06 12:56
Mark Salsbery20-Dec-06 12:56 
GeneralRe: Tab Control in existing dialog box Pin
acerunner31620-Dec-06 10:54
acerunner31620-Dec-06 10:54 

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.