[python-win32] SendMessage & WM_SYSKEYDOWN (Newbie)

Andy W toodles@yifan.net
Tue, 5 Mar 2002 13:18:04 +0800


Hi,

I am quite new to using the win32 programming, and would love some answers.

I am making a program that sends key and mouse messages to a window external
to it. I have managed to send WM_KEYDOWN, WM_CHAR and WM_KEYUP messages
successfully, as well as other non keyboard-related messages.
The program whose window that I wish to send messages to has customisable
hot-keys. ALT-P is one of them. I have looked through the win32gui
documents, and also have searched on the web. I found some websites saying
that I should send a WM_SYSKEYDOWN message. It was a little vague, and in
VB, so as a newbie I wasn't terribly confident in getting the right result.

I did the following:
win32gui.SendMessage(hWnd, WM_SYSKEYDOWN, ord("P"), 0)

This did nothing. Another website I looked at told me to set the 29th bit of
lparam. I did this, but still nothing...

Can someone please show how I should send such a message. I also would like
to do add control & shift modifiers, and have combinations.
If this request generates an "RTFM" reply, could someone please point me to
the "FM".

Thanks,
Andy W