How could I monitor the windows message and identify which pop up dialogue box belongs to which applicaion window.

I am building a test application to monitor what was activated and capture the events.