954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MessageBox

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.

magikman
Light Poster
29 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

I figured it out, thanks any way.

magikman
Light Poster
29 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You