winapi - In win32 C++ programming to close a window, should I call DestroyWindow(hWnd) myself or SendMessage(WM_CLOSE, hWnd, 0, 0)? -
i'm handling esc key in application , when key received wish close current window.
should call destroywindow(hwnd) or should sendmessage(wm_close, hwnd, 0, 0), or should closing current window in different way?
you should postmessage(hwnd, wm_close, 0, 0). puts wm_close message window's message queue processing, , window can close message queue cleared.
you should use postmessage instead of sendmessage. difference postmessage puts message message queue , returns; sendmessage waits response window, , don't need in case of wm_close.
Comments
Post a Comment