WM_CLOSE For a MDI Child
Hi,

I need to process WM_CLOSE for a MDI child Window so that I only make the window invisible-I do not want it to be destroyed. I face some problems with the following:
:
:
:
.ElseIf EAX==WM_CLOSE
invoke ShowWindow,hWnd,SW_HIDE
MOV eax,0
Ret
.EndIf

Invoke DefMDIChildProc,hWnd,uMsg,wParam,lParam
RET

The problem is that if some other MDI child Windows are visible at the same time, the focus is not forwarded to on one of them and this more annoying if the child Window I process was maximized.

Any ideas would be highly appreciated.
Posted on 2003-02-01 16:11:40 by akyprian
Hi akyprian

Try sending a WM_MDINEXT to the mdi client.

KetilO
Posted on 2003-02-01 16:39:42 by KetilO
Hi KetiIO,

I've already done so but there is a problem with the last window (close,restore,minimize buttons remain on the frame window).

Here is what i did:

.ElseIf EAX==WM_CLOSE
Invoke SendMessage,hClient,WM_MDINEXT,0,TRUE
invoke ShowWindow,hWnd,SW_HIDE
Return 0

Thanks once again KetiIo
Posted on 2003-02-01 17:27:02 by akyprian
As far as Microsoft is concerned you are not supposed to hide mdi children... the menu gets all jacked when you do hide the child because Windows simply doesn't expect it to ever be hidden in the first place. AFAIK the only workaround for this is to restore/minimize the window first, then hide it. You can stop the window animation with something like WM_SETREDRAW.
Posted on 2003-02-01 21:29:38 by BubbaFate
.ElseIf EAX==WM_CLOSE
Invoke LockWindowUpdate,hClient
Invoke SendMessage,hClient,WM_MDINEXT,0,TRUE
Invoke SendMessage,hClient,WM_MDIRESTORE,hWnd,0
Invoke ShowWindow,hWnd,SW_HIDE
Invoke LockWindowUpdate,0
Return 0
Posted on 2003-02-02 04:17:14 by akyprian