MessageBox with Help button

0.00 avg. rating (0% score) - 0 votes

Showing a four-button message box with the default set to the fourth button:


int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hinstPrev,
LPSTR lpCmdLine, int nShowCmd)
{
return MessageBox(NULL, TEXT(“Four buttons!”), TEXT(“Title”), MB_ABORTRETRYIGNORE | MB_HELP | MB_DEFBUTTON4);
}

Clicking on the Help button (MB_HELP) is documented as sending a WM_HELP message to your program. Since there is nothing to catch that message, it does nothing. The other buttons return the ID value of that button, dismissing the message box.

Reference:

msdn.com/oldnewthing/archive/2008/12/19/9239267.aspx

0.00 avg. rating (0% score) - 0 votes
ToughDev

ToughDev

A tough developer who likes to work on just about anything, from software development to electronics, and share his knowledge with the rest of the world.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>