Alex Rivera | Logout

Win32 custom message box

Asked 2011-10-21T09:43:59.483
8

I want to make a custom message box. What I want to customize is the button's text.

MessageBoxW(
  NULL,
  L"Target folder already exists. Do you want to overwrite the folder?",
  L"No title",
  MB_YESNOCANCEL | MB_ICONQUESTION
  );

I'd like to just change the buttons text to Overwrite, Skip, Cancel.
What's the most simple way?

I have to make this as having same look and feel with Windows default messagebox.

Edit
Report

2 Answers

2

You could create an own dialog. Or you could use a window hook as described in this article.

An archived version of the article can be found on web.archive.com.

answered 2011-10-21T10:00:49.110
1

Make a dialog resource (with a GUI editor, or by hand) and call DialogBox on it. There's no way to alter MessageBox behaviour, other than what's supported by its arguments.

That said, your message box can very well use stock Yes/No options.

answered 2011-10-21T09:46:38.667

Your Answer