[python-win32] Confused about PreTranslateMessage

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 6 07:04:55 CET 2009


I'm having trouble understanding how PreTranslateMessage
is supposed to work.

According to M$:

   Return value: Nonzero if the message was translated
   and should not be dispatched; 0 if the message was
   not translated and should be dispatched.

and according to the pywin32 docs:

   The result should be a tuple of the same format as
   the msg param, in which case the MSG structure will
   be updated and TRUE returned from the C++ function.

If all of that is true, I don't see what the purpose
is of updating the MSG, since it's just going to be
ignored when TRUE is returned.

But in any case it doesn't seem to be working -- the
original message gets dispatched anyway, regardless
of what I return from my PreTranslateMessage method.

So I'm totally confused at this point. Should I be
able to prevent the original message from being
dispatched, and if so, how do I go about it?

-- 
Greg


More information about the python-win32 mailing list