[comp.windows.ms] Problem with Multiple child windows

mdh@beach.cis.ufl.edu (Mark Hampton) (12/22/88)

Newsgroups: comp.winodws.ms
Subject: Problem with mutiple child windows...
Expires: 
References: 
Sender: 
Reply-To: mdh@beach.cis.ufl.edu ()
Followup-To: 
Distribution: world
Organization: UF CIS Department
Keywords: 

I am having a problem using multiple child windows. The project I am
working on requires that I use many child windows (akin to Excel's child
window for each file.). The problem I have is with setting one of the
many window as being active. By active, I mean that it's caption bar is
active, as is the main application's caption bar. All other child
windows have inactive caption bars. To accomplish this feat, the main
window (MainWnd), sends the active child a WM_ACTIVATE, 1, 0L. The child
window (ChildWnd) sends the currently active child window (if any) a
WM_ACTIVATE 0, 0L, and it sends itself a WM_NCACTIVATE, 1, 0L. If the
child window was selected via a mouse click, then I send MainWnd a
WM_ACTIVATE, 1, 0L (to keep it active). This seem to work outwardly, but
there are a couple of problems: The program will crash if the close box
on the child windows are played with too much. (ie, click on one's close
box, then move to another one and close it). I can't figure out where the
problem is. Also, the MainWnd sends all WM_CHAR messages to the active
window. If playing around with the Alt key, and a child's close box is
activated, the system locks up. 

Has anybody used multiple child windows (They are WS_CAPTION |
WS_CLIPCHILDREN | WS_SYSBOX | WS_MAXIMIZEBOX type.) ? I am trying to
follow the Style Guide's recommendations (for Multiple document
applications), but the implementation doesn't seem to work.
Thanks in advance.

Mark Hampton

----------------------------------------------------------------------------
In Real Life: Mark Hampton  | Internet: mdh@beach.cis.ufl.edu
                            | UUCP: ...gatech!uflorida!beach.cis.ufl.edu!mdh
----------------------------------------------------------------------------
--
----------------------------------------------------------------------------
In Real Life: Mark Hampton  | Internet: mdh@beach.cis.ufl.edu
                            | UUCP: ...gatech!uflorida!beach.cis.ufl.edu!mdh
----------------------------------------------------------------------------

rogerson@PEDEV.Columbia.NCR.COM (rogerson) (12/23/88)

	I have a program published by Microsoft and placed in
	the public domain called MDI.  This program shows how
	to implement the Multiple Document Interface.
	The program is just a skeleton, but it may help you
	with your program.  If you need/want it I will try to
	post it.

	-----Dale
		Rogerson-----