Category : C++ Source Code
Archive   : BWCC.ZIP
Filename : BDEFPROC.CPP

 
Output of file : BDEFPROC.CPP contained in archive : BWCC.ZIP
/**********************************************************************/
/* BDEFPROC.cpp by Bob Bourbonnais */
/* released to the public domain 1/26/92 */
/* This program shows how to add a default button */
/* processing function to a dialog box main window. */
/* To add the same functionality to a regular window */
/* over ride DefCommandProc instead of DefChildProc. */
/**********************************************************************/
#include
#include
#include "bwcc.h" // needed for BWCC

class TMyDialog : public TDialog // derive a class to add
{ // default button handling
public:
TMyDialog(LPSTR lpDialogName) // constructor calls
: TDialog(NULL,lpDialogName) // base class constructor
{
BWCCGetVersion(); // activate Borland Windows Custom Controls
}
virtual void DefChildProc(RTMessage Msg); // default button handler
};

void TMyDialog::DefChildProc(RTMessage Msg) // default button handler
{
MessageBeep(0); // make sound and display
BWCCMessageBox(HWindow,"Not Implemented", // a BWCC message box
"Feature",MB_OK);
TDialog::DefChildProc(Msg); // pass messages along
} // to base class handler

class TDialog1App : public TApplication // Application Class to contain
{ // the application
public:
TDialog1App(LPSTR lpName, HANDLE hInstance, // constructor calls the
HANDLE hPrevInstance, // base class constructor
LPSTR lpCmdLine, int nCmdShow)
:TApplication(lpName, hInstance,
hPrevInstance,
lpCmdLine, nCmdShow) {};

virtual void InitMainWindow(); // overrides base class InitMainWindow
};

void TDialog1App::InitMainWindow() // to initialize a dialog box
{ // as the main window
MainWindow = new TMyDialog("MAINWINDOWDIALOG");
}

int PASCAL WinMain(HANDLE hInstance, // main entry point from
HANDLE hPrevInstance, // windows to this program
LPSTR lpCmdLine , int nCmdShow)
{
TDialog1App Dialog1("Dialog Tester",hInstance, // create instance of
hPrevInstance, // the dialog application
lpCmdLine,nCmdShow);
Dialog1.Run(); // run it
return (Dialog1.Status); // exit
}
/**********************************************************************/


  3 Responses to “Category : C++ Source Code
Archive   : BWCC.ZIP
Filename : BDEFPROC.CPP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/