s_sagar4u
June 1st, 2009, 06:18 AM
Hi,
I am working on an application in VC++ and Win32. Currently I am having child dialog box on the Parent window. This child dialog has 2-3 Edit box controls and 2 Comboboxes and 2 buttons.
Now, the problem is, whenever user clicks on any of the Edit box (i.e. sets focus on the edit box by clicking on it) and clicks on Close (X) button on the parent window, my application is crashing.
The reason is, whever user clicks on Close button, my application is using DestroyWindow() to destroy the window. But since user has clicked on Edit box, it sends EN_KILLFOCUS message in the queue. This message is coming after I destroy the window. That means there is no handle available for EN_KILLFOCUS to process. That's why eventhough I try to handle this message in the dialog proc, it won't go there.
Please suggest me somthing on this.
Thanks in advance.
Regards,
Sagar
I am working on an application in VC++ and Win32. Currently I am having child dialog box on the Parent window. This child dialog has 2-3 Edit box controls and 2 Comboboxes and 2 buttons.
Now, the problem is, whenever user clicks on any of the Edit box (i.e. sets focus on the edit box by clicking on it) and clicks on Close (X) button on the parent window, my application is crashing.
The reason is, whever user clicks on Close button, my application is using DestroyWindow() to destroy the window. But since user has clicked on Edit box, it sends EN_KILLFOCUS message in the queue. This message is coming after I destroy the window. That means there is no handle available for EN_KILLFOCUS to process. That's why eventhough I try to handle this message in the dialog proc, it won't go there.
Please suggest me somthing on this.
Thanks in advance.
Regards,
Sagar