[python-win32] HookMessage fails

TK Soh teekaysoh at gmail.com
Tue May 15 15:15:11 CEST 2007


On 5/15/07, Niki Spahiev <niki at vintech.bg> wrote:
> TK Soh wrote:
> > Greeting.
> >
> > I built a custom dialog which would be resized by a handler connected
> > with HookMessage() to win32con.WM_SIZE. The dialogs are actually
> > called from the shell extension's context menu. Every seemed to work
> > well at first.
> >
> > The I noticed the resize handler is only called on the dialogs that
> > are called from the explorer window that made the first call. The same
> > dialogs that are called from other explorer windows seemed to have the
> > handler ignored. In fact I did some experiment indicating that the
> > problem is not unique to WM_SIZE, but any handlers that are hooked by
> > HookMessage.
> >
> > Appreciate if anyone can help shed some light on this. Thanks.
>
> In order to hook more messages (e.g. WM_SIZE) you must recompile pywin32
> with PYWIN_WITH_WINDOWPROC defined

I'm confused. The hooks appeared to work fine, though only in the
dialog opened from the specific explorer window as I described
earlier. I've tried WM_SIZE, WM_ACTIVATE, etc.

BTW, I'm using ActivePython 2.4, which comes with pywin32 bundled. I'm
not sure if PYWIN_WITH_WINDOWPROC is defined in ActivePython.


More information about the Python-win32 mailing list