views:

47

answers:

1

The application shall receive messages from all processes of the system. Messages are sent using PostMessage call, which returns an error (5, access denied).

The code works correctly on Windows XP SP2, but on Windows 7 application receive messages from only itself, which it should be supposed to get message from every application.

Reading the documentation of PostMessage, I can read:

When a message is blocked by UIPI the last error, retrieved with GetLastError, is set to 5 (access denied).

But actually it doesn't say how workaround this "UIPI". How do I?

+2  A: 

You can allow your program to receive a specific message by using ChangeWindowMessageFilterEx function.

Kirill V. Lyadvinsky
Great, it was what I was looking for! :)
Luca