Hello, everyone:

I have ventured into the world of windows API programming, unfortunately, my window is foggy at the moment. Maybe someone can clean it for me. :eek:

I feel as though this is something i should have taught myself before this point. But, at any rate, here is my problem.


I want to use a MessageBox to confirm on exit. Code i have thus far:

void __fastcall TMainForm::ExitClick(TObject *Sender)
{

        Application->MessageBox("Are you sure you want to exit?",
                                "Confirmation", MB_OKCANCEL);

       Application->Terminate( );
}

How do i keep the program from executing the Terminate() function? I am not sure how i capture and use the return value that the button click on the message box produces.

Compiler: Borland C++ 6

Thank you for your help.