When processing user input, the dialog manager makes some assumptions about the operation of specific controls. The dialog manager sends the WM_QUERYDLGCODE message to obtain a code that governs what assumptions can be made.
If the window receiving this message is not a control as defined above, this message returns 0.