Hello,
At some point in time I wrote a small utility to show what messages a window got. This was often useful not only to determine the messages the window got in specific situations but also the sequence in which it got them.
Somehow, I lost that utility. Since it does come in handy every now and then I figured I'd write it again and, this time, share it.
Attached is the source code which includes a Lazarus project file to get 32 and 64 bit debug and release versions.
Also attached is a screenshot of it running and what it shows.
There is a one-time setup you might want to do and that is, manually move the console window to be next to the GUI window, set its width to 120 (the output will wrap if the width is insufficient causing it to be hard to read), lastly set the screen buffer size to 9999. That is normally sufficient to see what messages the window is getting without loss due to scrolling.
It's not the kind of utility you'll need very often but, when you need it, it is very handy.
HTH.