PDA

Click to See Complete Forum and Search --> : How do I do a yes/no box?


Wynd
Mar 1st, 2001, 06:59 PM
For example in JavaScript you can write:

var someVar = confirm("Some Text");

Is there an API function or something that I can use in C++? Thanks in advance.

Technocrat
Mar 2nd, 2001, 09:51 AM
By "box" do you mean a message box?

Mar 2nd, 2001, 10:36 AM
MessageBox(NULL, "Hello", "HELLO", MB_YESNO);

Wynd
Mar 2nd, 2001, 06:41 PM
Ok, thanks chimpface.

Wynd
Mar 2nd, 2001, 06:48 PM
One more question, how would I tell how what the user press (yes or no)?

Mar 4th, 2001, 12:10 PM
int n = MessageBox(NULL, "Hello", "HELLO", MB_YESNO);

if( n == IDYES ) // Yes was pressed
if( n == IDNO ) // No was pressed

Wynd
Mar 4th, 2001, 06:16 PM
Ok, thanks a lot megatron.

Mar 4th, 2001, 06:39 PM
No problem

sail3005
Mar 7th, 2001, 08:20 PM
how would you make a prompt box?

like in javascript:



var input = prompt("Enter a number");