PostQuitMessage

Started by Patrice Terrier, March 02, 2010, 02:22:08 PM

Previous topic - Next topic

Patrice Terrier

Paul

When a modal child popup window use PostQuitmessage in answer to a %WM_DESTROY message, this close not only the modal child popup, but also the parent main popup window.

...



Paul Squires

Thanks Patrice,

Why would you use PostQuitMessage in a modal child popup window? FireFly automatically adds PostQuitMessage to the main startup form in the project.

You are correct however, using PostQuitMessage in the child popup window's WM_DESTROY does cause the program to exit - maybe that is what should happen?
Paul Squires
PlanetSquires Software

Patrice Terrier

#2
>>maybe that is what should happen?

With DDT (CreateDialog), PostQuitMessage could also be used to shutdown a child popup window, without closing the main application.

Indeed, PostQuitMessage can also be used to exit a child thread message loop (like with the MessageBox API).

The way i understand the MSDN documentation is that PostQuitMessage, must apply to the current process and its child process, not to its parent process, like when using directly the DestroyWindow API.

...