We have an application that uses the window message queue to pass data from a socket to consumer HWNDs (at a rate of ~2100Hz). This application has worked for >2 years. Recently our application has started exhibiting problems where WM_TIMER is not being fired/executed by our application. I think this is due to the data being pumped into the message queue.
My question is there a way to determine how many pending messages are in the message queue for a given thread/HWND?
There isn't a good way to do this. One thing you could do is aggressively empty the message que and put them in your own queue. But, this will not solve your problem.
I hate telling you this, but you should really find a way to process your socket data. I think you will find some other mechanism scales better, performs better, and is easier to debug than using the windows message queue for this.
Foredecker