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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -