Andrew Truckle
Andrew Truckle

Reputation: 19117

Is it possible to widen a message box in MFC?

I display a message box using the AfxMessageBox keyword. Basic stuff.

But, due to the length of the path, it displays like this:

Message Box

Is there any way that I can stop it from word wrapping that way?

Sorry if this is a dumb question. But if I have a single sentence it would normally show wider.

Thank you.

Upvotes: 3

Views: 1252

Answers (2)

sergiol
sergiol

Reputation: 4335

You can override CWinApp::DoMessageBox on your derived class and supply your own message dialog, customized in the way you want. All AfxMessageBox calls will get your override in the way.

Upvotes: 1

IInspectable
IInspectable

Reputation: 51413

AfxMessageBox eventually calls MessageBox. There is no way for an application to (easily) modify, how the system displays the message box.

If you need a custom message box dialog, you will have to implement your own.

Background information on the evolution of the layout algorithm used by the MessageBox was published by Raymond Chen at The Old New Thing: Why doesn’t my MessageBox wrap at the right location?

Upvotes: 3

Related Questions