I dont use Borland (I use MSVC), so I am not used to its clas library (if indeed you are using that!)..
Originally posted by Roul
Come on guys, I know that is a stupid question, but I need a stupid answer! Hehe, I hate borland.
Basically......You have a dialogbox or a window for which you added a button......On clicking that button, the window/dialogbox will recieve a WM_COMMAND message from the system...
So in you code you need to handle that message. Whenever you recieve one, and you identify that it came from your button, you close the program with something like PostQuitMessage() or whatever is suitable....
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // item, control, or accelerator identifier
hwndCtl = (HWND) lParam; // handle of control
The way you identify that button is either by;
LOWORD(wParam) - this will be the number that identifys the button as specified in your resource editor
(HWND) lParam - This will be the windows handle of the button.
Sorry if this is a little vague, but you havent really provided the specifice of how you created your button......so I have to be vague.