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

C / C++ / MFC

 
AnswerRe: Closing Program, shutting down c++ win32. Pin
Mohibur Rashid10-Jan-12 14:11
professionalMohibur Rashid10-Jan-12 14:11 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Richard MacCutchan10-Jan-12 21:58
mveRichard MacCutchan10-Jan-12 21:58 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Mohibur Rashid10-Jan-12 22:09
professionalMohibur Rashid10-Jan-12 22:09 
GeneralRe: Closing Program, shutting down c++ win32. Pin
Richard MacCutchan10-Jan-12 22:48
mveRichard MacCutchan10-Jan-12 22:48 
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 
I just came to that conclusion, that I did not handle my WndProc Correctly. So I started to remodel it with a better understanding. I must admit that I should check for open threads still running during one of the events.

I do need some help in organization and clarity here.

WM_CLOSE
Gives me a chance to do something before WM_DESTROY is called

WM_DESTROY
That's it, shutting down, I must do something, or it just shuts down

WM_QUIT
I'm suppose to PostQuitMessage(0), 0 means close, 1 means abort?

C#
case IDM_FILE_EXIT:
PostMessage(hWnd, WM_CLOSE, 0, 0);
break;



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

  switch ( msgboxID )
  {
      case IDOK:
      PostQuitMessage(0);
      DestroyWindow(hWnd);
      break;

      case IDCANCEL:
      PostQuitMessage(1);
      break;
  }
  break;

  case WM_DESTROY:
      // Perform Cleanup Tasks

      break;

  case WM_QUIT:

      PostQuitMessage(0);
      break;

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 
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 

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.