PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Patrice Terrier on March 02, 2010, 02:22:08 PM

Title: PostQuitMessage
Post by: Patrice Terrier on March 02, 2010, 02:22:08 PM
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.

...


Title: Re: PostQuitMessage
Post by: Paul Squires on March 03, 2010, 08:32:01 AM
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?
Title: Re: PostQuitMessage
Post by: Patrice Terrier on March 03, 2010, 09:36:57 AM
>>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.

...