Author: Larry LindstromLarry Lindstrom
Date: Apr 27, 2008 01:25
Hi Folks:
I have an MDI application that I'm making behave in a way an
MDI app was never intended to behave.
What could go wrong? :)
I could fill a page describing what I'm trying to do, but it
breaks down to building my own desktop inside of an MDI frame.
This means maintaining multiple parent-modal child relationships,
let's call them tasks. As is described in Google's archives for
this group, having a child disable it's parent is a common
method to maintain a parent-modal child relationship among the
children of an MDI frame.
A stack is built with the handles of each MDI child and
DeferWindowPos() is used to place the window to be active
and in focus at the top of the Z order. I use
EnableWindow(, TRUE) followed immediately by SetFocus() to
bring the MDI child into focus.
This works almost perfectly. But in certain, repeatable,
situations the window is enabled, but doesn't receive focus,
with the darker blue frame.
|