REQ : Question with message box.
-
My code:
#include "stdafx.h" #include INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow); void main() { MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL); }
How can you make it so if he clicks yes it prints "Good Choice" and if he clicks no it will open a ".com" file? Any resposes will be very helpful. Another passing being longing to enhance his intellect. Gnaritas est potestas. Knowledge is power. -
My code:
#include "stdafx.h" #include INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow); void main() { MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL); }
How can you make it so if he clicks yes it prints "Good Choice" and if he clicks no it will open a ".com" file? Any resposes will be very helpful. Another passing being longing to enhance his intellect. Gnaritas est potestas. Knowledge is power.int nResponse = MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", MB_YESNOCANCEL);
if (IDYES == nResponse)
MessageBox(NULL, "Response", "Good Choice", MB_OK);
else if (IDNO == nResponse)
// open .com file
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
My code:
#include "stdafx.h" #include INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow); void main() { MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL); }
How can you make it so if he clicks yes it prints "Good Choice" and if he clicks no it will open a ".com" file? Any resposes will be very helpful. Another passing being longing to enhance his intellect. Gnaritas est potestas. Knowledge is power.MessageBox returns a value which indicates whether the user choose yes or no.
int nResult = MessageBox(...); // User clicked Yes if (nResult == IDYES) ... // User clicked No else if (nResult == IDNO) ...
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest -
MessageBox returns a value which indicates whether the user choose yes or no.
int nResult = MessageBox(...); // User clicked Yes if (nResult == IDYES) ... // User clicked No else if (nResult == IDNO) ...
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest -
My code:
#include "stdafx.h" #include INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow); void main() { MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL); }
How can you make it so if he clicks yes it prints "Good Choice" and if he clicks no it will open a ".com" file? Any resposes will be very helpful. Another passing being longing to enhance his intellect. Gnaritas est potestas. Knowledge is power.