KMA
KMA

Reputation: 211

Add Custom button caption to message box

I want to have two buttons 'Stop' and 'Continue' in my messagebox. Can we have custom buttons in messagebox?

Upvotes: 1

Views: 1173

Answers (1)

zett42
zett42

Reputation: 27786

Beginning with Windows Vista, the OS provides the TaskDialog API as a replacement of the simpler but limited MessageBox() function.

Specifically, the TaskDialogIndirect() function allows you to define custom buttons with individual labels. There is an example on the linked MSDN page.

If you have to support OS versions older than Vista, there are projects like this which emulate the TaskDialog functionality.

Upvotes: 3

Related Questions