|
-
April 3rd, 1999, 01:42 PM
#1
MessageBox controls
I created a yes/no message box in a MDI application as follows:
void CMainFrame::OnDialogsMessage()
{ MessageBox("Message", "Title", MB_YESNO; }
How can I output to the MDI child the messages "user clicked yes" or "user clicked no" when the user clicks either the yes or no option?
Any response anyone can give me will be greatly appreciated.
-
April 3rd, 1999, 04:39 PM
#2
Re: MessageBox controls
Take the return value of MessageBox(...) function. It returns one of the following values in your case:
IDYES - if the user clicked 'Yes'
IDNO - if the user clicked 'No'
So you can write a code similar to this:
...
int nSelection;
nSelection = MessageBox("Message", "Title", MB_YESNO);
if (nSelection == IDYES)
{
// action for YES
}
else
{
// action for NO
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|