[python-win32] Re: Help on using win32api.SendMessage to send keystrokes

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Thu Mar 31 09:45:13 CEST 2005

Daniel F wrote:

> Well... i figured it out - turns out sending the keystrokes to the top
> window of notepad didnt work, but sending them to the Edit child
> window of notepad did the trick.
> But this brings me to another question, although of a less urgent
> manner. i had to send WM_CHAR messages, rather than WM_KEYDOWN/KEYUP
> in order to get it to work. I have nothing against WM_CHAR, as long as
> everything works, but i am just curious why i was not able to achieve
> the same effect with the WM_KEYDOWN/KEYUP pair? any takers?

I noticed in the MSDN documentation for WM_KEYUP that bits 30 and 31 of
lParam should be set, while you leave all bits zero. Maybe that has to
do something with it?

If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven

More information about the Python-win32 mailing list