Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Mohibur Rashid10-Jan-12 23:01
professionalMohibur Rashid10-Jan-12 23:01 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Richard MacCutchan10-Jan-12 23:11
mveRichard MacCutchan10-Jan-12 23:11 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Mohibur Rashid11-Jan-12 0:37
professionalMohibur Rashid11-Jan-12 0:37 
AnswerI need to get schooled on shutting down my program Pin
jkirkerx11-Jan-12 8:14
professionaljkirkerx11-Jan-12 8:14 
GeneralRe: I need to get schooled on shutting down my program Pin
Wes Aday11-Jan-12 8:21
professionalWes Aday11-Jan-12 8:21 
GeneralRe: I need to get schooled on shutting down my program Pin
jkirkerx11-Jan-12 8:34
professionaljkirkerx11-Jan-12 8:34 
GeneralRe: I need to get schooled on shutting down my program Pin
Wes Aday11-Jan-12 8:39
professionalWes Aday11-Jan-12 8:39 
GeneralRe: I need to get schooled on shutting down my program Pin
jkirkerx11-Jan-12 9:17
professionaljkirkerx11-Jan-12 9:17 
I need to fix my child window first. I think I have the main window fixed. I have the same loop in the parent window and child window, so the child window is still running the loop when I try to shutdown the main window.

Now I'm starting to think that I have to call DestroyWindow for each control as well.

Main Window
C#
case WM_CLOSE:
        {
            // Catch the Event and do something before shutting down
            msgboxID = MessageBoxEx(g_hWndMainFrame,
            L"Are you sure you wish to quit Internet Commerce Engine 5",
            L"Question",
            MB_OKCANCEL | MB_DEFBUTTON1 | MB_ICONINFORMATION,
            LANG_NEUTRAL
            );

            switch ( msgboxID )
            {
                case IDOK:
                    Sleep(1000);
                    PostQuitMessage(0);

                    //return 0;
                    break;

                case IDCANCEL:
                    return 1;
                    break;
            }
        }
        break;

    case WM_DESTROY:
        DestroyWindow(hWnd);
        break;

    case WM_QUIT:

        break;


Child Window

case WM_CLOSE:			
{
	HMENU	hMenu;
	HMENU	hManagementMenu;
		
	hMenu = GetMenu( gUserAccount_Index_GAC );
	EnableMenuItem(hMenu, 1, MF_BYPOSITION | MF_ENABLED);            
	hManagementMenu = GetSubMenu(hMenu, 1);
	EnableMenuItem(hManagementMenu, IDM_MANAGEMENT, MF_BYCOMMAND | MF_ENABLED);
	DrawMenuBar( gUserAccount_Index_GAC );				
}

return 0;
break;
		
case WM_DESTROY:
{
	if ( hUserAccount_Index ) 
		hUserAccount_Index = NULL;

	DestroyWindow(lbl_UserAccount_Index_Label);
	DestroyWindow(lb_UserAccount_Index_Listbox_Field);
	DestroyWindow(bt_UserAccount_Index_Add);
	DestroyWindow(bt_UserAccount_Index_Edit);
	DestroyWindow(bt_UserAccount_Index_Delete);
	DestroyWindow(bt_UserAccount_Index_Exit);	
	DestroyWindow(cWnd);
	}
	return 0;
	break;

	case WM_QUIT:
					
	break;

GeneralI want the message loop in the mdi child window for the tab function Pin
jkirkerx11-Jan-12 14:17
professionaljkirkerx11-Jan-12 14:17 
GeneralRe: I need to get schooled on shutting down my program Pin
Stefan_Lang12-Jan-12 1:31
Stefan_Lang12-Jan-12 1:31 
GeneralRe: I need to get schooled on shutting down my program Pin
jkirkerx12-Jan-12 6:12
professionaljkirkerx12-Jan-12 6:12 
QuestionCompiler Error ??? Pin
ForNow10-Jan-12 5:23
ForNow10-Jan-12 5:23 
AnswerRe: Compiler Error ??? Pin
Albert Holguin10-Jan-12 5:46
professionalAlbert Holguin10-Jan-12 5:46 
AnswerRe: Compiler Error ??? Pin
Chuck O'Toole10-Jan-12 6:16
Chuck O'Toole10-Jan-12 6:16 
QuestionRe: Compiler Error ??? Pin
CPallini10-Jan-12 9:32
mveCPallini10-Jan-12 9:32 
AnswerRe: Compiler Error ??? Pin
Richard MacCutchan10-Jan-12 11:59
mveRichard MacCutchan10-Jan-12 11:59 
GeneralRe: Compiler Error ??? Pin
CPallini10-Jan-12 21:32
mveCPallini10-Jan-12 21:32 
AnswerRe: Compiler Error ??? Pin
Mohibur Rashid10-Jan-12 14:15
professionalMohibur Rashid10-Jan-12 14:15 
GeneralRe: Compiler Error ??? Pin
Stefan_Lang12-Jan-12 1:23
Stefan_Lang12-Jan-12 1:23 
AnswerRe: Compiler Error ??? Pin
Eytukan11-Jan-12 0:37
Eytukan11-Jan-12 0:37 
Question.ani picture or animation control Pin
Chris Geddes10-Jan-12 1:45
Chris Geddes10-Jan-12 1:45 
QuestionRe: .ani picture or animation control Pin
Richard MacCutchan10-Jan-12 2:33
mveRichard MacCutchan10-Jan-12 2:33 
AnswerRe: .ani picture or animation control Pin
Albert Holguin10-Jan-12 3:44
professionalAlbert Holguin10-Jan-12 3:44 
GeneralRe: .ani picture or animation control Pin
Chris Geddes11-Jan-12 1:00
Chris Geddes11-Jan-12 1:00 
QuestionEmbedding a CDialog in a CMFCOutlookbar Pin
UrbanBlues9-Jan-12 11:16
UrbanBlues9-Jan-12 11:16 

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.