🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2
Article #480

Owned windows and WM_DESTROY in MDI

#480
From: Paul G. Weiss
Date: Fri, 13 Apr 1990 14:54
23 lines
1459 bytes
The sample application MDI shipped with the developer's kit contains
something that has been mystifying me.

In order to make the system menu and minmax button of document windows
disappear when they are deactivated the parent of these windows is
set to HWND_OBJECT when deactivated and to the document frame window
when reactivated.  So far, so good.

What is puzzling is that the document frame window procedure handles
WM_DESTROY by setting the parent of these windows back to the frame
with a comment saying that this is necessary to insure that they are
destroyed.  But is it really necessary?  These windows are still OWNED
by the frame window even though they are no longer children and according
to the documentation, owned windows should automatically be destroyed.

With this in mind I decided to remove the two calls to WinSetParent from
the code and lo and behold, I get a RIP on the debugging terminal saying
that a window has not been destroyed and then another one complaining of
an invalid heap handle.

Can anyone explain this?

-Puzzled
Technical Details
Message-ID: <WEISS.90Apr13105430@toucan.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!yale!mintaka!mintaka!weiss

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!yale!mintaka!mintaka!weiss
From: weiss@theory.lcs.mit.edu (Paul G. Weiss)
Newsgroups: comp.os.os2
Subject: Owned windows and WM_DESTROY in MDI
Message-ID: <WEISS.90Apr13105430@toucan.lcs.mit.edu>
Date: 13 Apr 90 14:54:30 GMT
Sender: news@mintaka.lcs.mit.edu
Distribution: comp
Organization: MIT Lab for Computer Science
Lines: 23