user1438599
user1438599

Reputation:

Are DialogBox messages sent to a custom message loop?

I have an application that currently has a message loop. If I were to create a modal dialog box with the DialogBox method would the current message loop receive messages from the dialog as well or would they be withheld by the runtime?

Upvotes: 1

Views: 804

Answers (2)

shf301
shf301

Reputation: 31404

DialogBox creates its own message loop so your message loop will not run. From the documentation:

The function displays the dialog box (regardless of whether the template specifies the WS_VISIBLE style), disables the owner window, and starts its own message loop to retrieve and dispatch messages for the dialog box.

Upvotes: 2

Superman
Superman

Reputation: 3081

Your existing message loop will not receive the messages for the dialog box. All messages for the dialog would be received by the DLGPROC method that you're passing as the last parameter to the DialogBox function.

Upvotes: 1

Related Questions