2012/4/8 Dmitry Timoshkov <dmi...@baikal.ru>: > Daniel Jelinski <djelins...@gmail.com> wrote: > >> Skipping tests on WinNT - older versions of comctl send a different >> set of events. > > Then you need to figure out what is different, and make the tests pass > there as well (there is 'optional' flag for that), otherwise you risk > breaking applications written for NT.
Okay, I'll do that. I thought that since comctl is supposed to be backwards compatible, I'll write the tests to just pass on the newer version. >> + /* WM_RBUTTONDOWN does not return until it gets another mouse event. >> + Make sure it gets one by posting WM_RBUTTONUP to message queue */ >> + PostMessageA(hTree, WM_RBUTTONUP, 0, (LPARAM)0x10001); >> + /* this sequence should NOT send WM_CONTEXTMENU */ >> + SendMessageA(hTree, WM_RBUTTONDOWN, 2, (LPARAM)0x10001); >> + >> + /* ditch the first sequence as it processed more messages than we need. >> Redo */ >> + flush_sequences(sequences, NUM_MSG_SEQUENCES); >> + >> + PostMessageA(hTree, WM_RBUTTONUP, 0, (LPARAM)0x10001); >> + SendMessageA(hTree, WM_RBUTTONDOWN, 2, (LPARAM)0x10001); > > This can't work. If you use PostMessage you need to flush message queue before > testing the sequence. Using SendMessage after PostMessage doesn't guarantee > that a posted message is handled before a sent one, you may try generating > hardware messages instead. I want the posted message to be handled after the sent one, and I get exactly that. The event handler for WM_RBUTTONDOWN captures all messages until it finds one of the mouse-related events, so I needed to post WM_RBUTTONUP first to make sure that SendMessage returns. Hardware messages are an alternative, but I couldn't find any relevant examples, so I followed the path of least resistance. The first PostMessage/SendMessage sequence flushes the message queue, or at least its interesting part. There are probably better ways (PeekMessage/DispatchMessage loop comes to mind), but this one just works. > >> + >> + if(sequences[PARENT_SEQ_INDEX]->sequence->message == 0x133) >> + { >> + win_skip("Comctl32 versions prior to 5.80 send different set of >> events"); >> + return; >> + } > > Please use symbolic names for messages instead of magic numbers. Ok, can do. Best regards, Daniel