user32 - set_active_window uses SendMessage instead
ofPostMessage for WM_ACTIVATEAPP messages.
Peter Dons Tychsen
donpedro at tdcadsl.dk
Sat Aug 4 16:50:00 CDT 2007
On Sat, 2007-08-04 at 12:04 +0900, Dmitry Timoshkov wrote:
> "Peter Dons Tychsen" <donpedro at tdcadsl.dk> wrote:
> > 1) Yes i did testing on Windows-XP. I did it by putting together various
> > examples and by checking with InSendMessage() for all cases. This
> > clearly showed that WM_ACTIVATEAPP was always posted and never sent.
Thanks for your comments,
> Looks like you misunderstood the InSendMessage behaviour and that led to
> some confusion.
I sure did! I must have been tired or something :-). When i went back
and tested it again i did verify that it worked differently than i
expected. Even the InSendMessageEx() did not work as i expected. The
MSDN documentation also seems vague on this. Anyway, you are right.
> Wine test harness for message sequences works just fine, there is no need
> to blame it.
I'm not blaming it for anything. I am just pointing out that it does not
work if you want to test for posted messages. It has a bit bit-mask
which describes if the tested message is sent or posted. However the
framework does not make sure that posted messages are actually received
before it starts comparing. Look at the way the ok_sequence_() works. It
compares with the messages which are picked up in the WinProc()
1) It does not make sure that all messages are received before
comparing. I believe the best (maybe the only?) way of doing this would
be to do:
while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
I don't see how you otherwise can make sure that all messages are
received before comparing. Currently the existing test cases almost only
checks for sent messages and not posted ones. This i probably why the
current cases wok as well as they do.
2) It does not actually check if the message was posted or sent. This
would make sense. I was too quick in assuming that this could be done
with InMessageSend(). I was wrong. Maybe another mechanism can be used?
I will go back and figure out a better way of checking these things if i
can. I still think the test system needs a fix-up.
More information about the wine-devel