[python-win32] HookMessage fails

Mark Hammond mhammond at skippinet.com.au
Wed May 16 03:13:54 CEST 2007


> > This is the magic of MFC - if no parent is specified, the
> "main window" for
> > the application is automatically used.
> >
>
> Isn't that the issue, then?  He's writing a dialog to plug in to
> Explorer, and every time he runs, there's a different "main window".
> MFC gets its concept of a "main window" from its global
> state, so unless
> something in the process tells MFC to refresh its global
> state, it will
> have stale information.

Quite possibly - I'm afraid I can't recall the exact semantics for dialog
based apps, but I suspect that a number of things in MFC will end up getting
upset if the nominated main window dies but the application does not - but
win32ui.GetApp().SetMainFrame() can be used to change this value
dynamically.  I'm afraid I haven't found the time to read the other messages
in enough detail to offer more concrete suggestions (other than to possibly
consider using win32gui to avoid future MFCisms from biting)

Cheers,

Mark



More information about the Python-win32 mailing list