Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

messagebox() 1

Status
Not open for further replies.

computerwhiz

Programmer
May 1, 2002
28
US
how do I use the results from a user pressing "yes" or "no" in a message box? an if statement or in wndproc area?

Code:
INT Result = MessageBox(
   hwnd, "This file has not been parsed.\r\n"
   "Do you want to Parse this file now?",
   "File not parsed",
   MB_YESNO | MB_DEFBUTTON1 | MB_ICONQUESTION);
   
   if(Result = IDYES)
   {
      PostMessage(hwnd, WM_COMMAND, CM_PARSE_FILE, 0);
   }
 
Looks fine, except it should read
Code:
if(Result == IDYES)


/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
ohh man that was so duh. thanks, that was my dumb moment for the day.
 
Don't worry computerwhiz, I did the same thing once... except that it was burried in almost 3,000 lines of code and I got no compiler error -- the program just crashed. It took me over an hour just to find out that the problem was just in that single operator. So... don't feel bad, happens to everyone.

-Bones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top