c - How can I cause my MessageBox to pop up on top of all forms? -


I am presently providing the user information with a message box in my C program, but the message box The look behind is the appearance of my application.

How can I bring it forward so that it can appear in front of all my forms, or can my parents set it?

To show the message box:

  messagebox (0, error_mMS, "error - no algorithm", MB_OK);    

This is the reason to appear in front of all forms because you have not specified the owner Window. This causes the desktop to appear directly at the top of the window The problem is that your other windows are already covering the desktop window, so they are also keeping your message box happy.

The solution, as you suspect, is to specify one of your windows. The owner for the message box, you handle your window ( HWND ) as the first argument of the function By specifying:

  message box (hWnd, // window handle for your owner window error_msg, // display "error - not algorithm", // title mb_ok) ;   

Provides additional information.

Comments