Wm_close & Wm_destroy

This is a discussion on Wm_close & Wm_destroy within the C++ Programming forums, part of the General Programming Boards category; What's the difference between them? here's a part of example in my tutorial : switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    85

    Wm_close & Wm_destroy

    What's the difference between them?

    here's a part of example in my tutorial :

    switch(msg)
    {
    case WM_CLOSE:
    DestroyWindow(hwnd);
    break;
    case WM_DESTROY:
    PostQuitMessage(0);
    break;
    default:
    return DefWindowProc(hwnd, msg, wParam, lParam);
    }

    can I change it to:

    switch(msg)
    {
    case WM_CLOSE:
    DestroyWindow(hwnd);
    PostQuitMessage(0);
    break;
    default:
    return DefWindowProc(hwnd, msg, wParam, lParam);
    }

  2. #2
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    I dont really know but I guess that WM_Close is closing it from the X button or Alt+F4 and the WM_Destroy could be from Ctrl+Alt+Delete or just Restart Or Shut-Down PC. But I dont really know.
    what does signature stand for?

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21