Hi.
I have a question, I like the MessageBox in my my program but not to much windows. I created this little program in a couple of minuts but I have a problem: I really like that before the program starts that he ask if you want to you it, that's quite simple but I want the MessageBox who ask if you want to use it, displaying first before the black Win 32 Console screen (*.exe) displays (shows up) and that if you click on "No" that he quits ( exit (0); ) but if you quit the Win 32 Console still mussn't be displayed and "Yes", then it starts:
I don't know much about all that windows code (only MB, a bit), maybe it is possible in C++ but if it just works it's fine.Code:#include <iostream> #include <windows.h> using namespace std; int one; int two; int three; int four; int main() { cout<<"Hi there, typ in 100: "; cin>> one; cout<<endl; if ( one == 100 ){ cout<<endl; cout<<"Good, thanks for using this software."<<endl; cout<<endl; Sleep(3000); three = MessageBox( 0, "Do you want to quit?", "Quit", 4 ); if (three == IDNO){ main(); } } else{ cout<<endl; cout<<"You need to typ 100 not something else!"<<endl; cout<<endl; cout<<"Do you want to try again or quit? Press 1 to try again, 2 to stop: "; cin>> two; cout<<endl; } if ( two == 1 ){ main(); } else{ four = MessageBox( 0, "Thank you for using this software!", "Bye", MB_ICONEXCLAMATION ); if (four == IDOK){ cout<<"BYEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!"<<endl; cout<<endl; Sleep(1000); exit(0); } } }



LinkBack URL
About LinkBacks


