Home > Software engineering >  Is there a way to make MessageBox not freeze the application?
Is there a way to make MessageBox not freeze the application?

Time:01-01

I'm currently experimenting around with message boxes using the Windows.h module in C and I'm curious if there is a way to make the function not hang/freeze the application.

I tried using the MessageBox function and it just hangs/freezes the application until there is user input to the messagebox

Thanks!

CodePudding user response:

The Windows API function MessageBox will create a modal dialog box, which means that the owner window gets disabled and the function will only return as soon as the dialog box is closed.

If you don't want the owner window to get disabled and want the function to return immediately, you should instead create a modeless dialog box using the functions CreateDialog or CreateDialogIndirect.

  • Related