Why doesn’t WM_ENTERIDLE work if the dialog box is a MessageBox?
The trick is that I used the common file open dialog instead of a simple MessageBox. Indeed, if you replace the call to GetOpenFileName with a call to MessageBox, then no WM_ message arrives, and you get no beeping. What’s going on?
A dialog can suppress the WM_ message by adding the DS_ dialog style to its template. And that’s what the template used by the MessageBox function does.
So the WM_ trick does require a small amount of cooperation from the dialog box, namely that it doesn’t disable WM_ messages.
But say you can guarantee the cooperation of the dialog box because you are the dialog box. Right now, the WM_ message allows a dialog owner to be notified when the dialog message loop is about to go idle. But what if the dialog box itself wants to know, so it can customize its own message loop?
We’ll look at that next time.
The post Why doesn’t <CODE>WM_<WBR>ENTERIDLE</CODE> work if the dialog box is a <CODE>MessageBox</CODE>? appeared first on The Old New Thing.